SlideShare a Scribd company logo
Module-2 Using Linux
Command Shell
Tushar B Kute
tushar.kute@gmail.com
http://snashlug.org
contact@snashlug.org
UNIX Commands
Linux Commands
A command is a program which interacts with the
kernel to provide the environment and perform the
functions called for by the user.
A command can be: a built-in shell command; an
executable shell file, known as a shell script; or a
source compiled, object code file.
The shell is a command line interpreter. The user
interacts with the kernel through the shell. You can
write ASCII (text) scripts to be acted upon by a
shell.
UNIX Shell
The shell sits between you and the operating
system, acting as a command interpreter.
It reads your terminal input and translates the
commands into actions taken by the system. The
shell is analogous to command.com in DOS.
When you log into the system you are given a
default shell.
When the shell starts up it reads its startup files
and may set environment variables, command
search paths, and command aliases, and executes
any commands specified in these files.
UNIX Shell
Linux Commands
The original shell was the Bourne shell, sh.
Every Unix platform will either have the Bourne shell,
or a Bourne compatible shell available.
The default prompt for the Bourne shell is $ (or #, for
the root user).
Another popular shell is C Shell. The default prompt
for the C shell is %.
UNIX Shell
Linux Commands
Numerous other shells are available from the
network. Almost all of them are based on either sh
or csh with extensions to provide job control to sh,
allow in-line editing of commands, page through
previously executed commands, provide command
name completion and custom prompt, etc.
Some of the more well known of these may be on
your favorite Unix system: the Korn shell, ksh, by
David Korn and the Bourne Again SHell, bash,
from the Free Software Foundations GNU project,
both based on sh, the T-C shell, tcsh, and the
extended C shell, cshe, both based on csh.
LINUX COMMANDS
Linux Commands
File Management and Viewing
File-system Management
Help, Job and Process Management
Network Management
System Management
User Management
Printing and Programming
Document Preparation
Miscellaneous
Command Structure
Linux Commands
Command <Options> <Arguments>
Multiple commands separated by ; can be executed
one after the other
Help Facilities for Commands
Linux Commands
To understand the working of the command and
possible options use (man command)
Using the GNU Info System (info, info command)
Listing a Description of a Program (whatis command)
Many tools have a long−style option, `−−help', that
outputs usage information about the tool, including
the options and arguments the tool takes.
Ex: whoami --help
Pipes
Linux Commands
An important early development in Unix was the
invention of "pipes," a way to pass the output of one
tool to the input of another.
eg. $ who | wc −l
By combining these two tools, giving the wc
command the output of who, you can build a new
command to list the number of users currently on the
system
Linux File Management and Viewing
Linux Commands
File and Directory management
cd Change the current directory. With no arguments
"cd" changes to the users home directory. (cd
<directory path>)
chmod Change the file permissions.
Ex: chmod 751 myfile : change the file permissions
to rwx for owner, rx for group and x for others
Ex: chmod +r myfile
chmod -w myfile
Linux File Management and Viewing
Linux Commands
chown Change owner.
Ex: chown <owner1> <filename> : Change ownership
of a file to owner1.
chgrp Change group.
Ex: chgrp <group1> <filename> : Change group of a
file to group1.
cp Copy a file from one location to another.
Ex: cp file1 file2 : Copy file1 to file2
Ex: cp –R dir1 dir2 : Copy dir1 to dir2
Linux File Management and Viewing
Linux Commands
ls List contents of a directory.
Ex: ls, ls –l , ls –al, ls –ld, ls –R
(-rwxrwxr-x 1 juan juan 0 Sep 26 12:25 foo )
|more will list page wise
mkdir Make a directory.
Ex: mkdir <directory name> : Makes a directory
Ex mkdir –p /www/chache/var/log will create all the
directories starting from www.
mv Move or rename a file or directory.
Ex: mv <source> <destination>
Linux File Management and Viewing
Linux Commands
find Find files (find <start directory> -name <file name> -print)
Ex: find /home –name readme -print
(Search for readme starting at home and output full path.)
“/home" = Search starting at the home directory and proceed
through all its subdirectories
"-name readme" = Search for a file named readme
"-print" = Output the full path to that file
locate File locating program that uses the slocate database.
Ex: locate –u to create the database,
locate <file/directory> to find file/directory
Wild card characters?
Linux File Management and Viewing
Linux Commands
pwd Print or list the present working directory with
full path.
rm Delete files (Remove files). (rm –rf
<directory/file>)
rmdir Remove a directory. The directory must be
empty. (rmdir <directory>)
touch Change file timestamps to the current time.
Make the file if it doesn't exist. (touch <filename>)
whereis Locate the binary and man page files for a
command. (whereis <program/command>)
which Show full path of commands where given
commands reside. (which <command>)
Linux File Management and Viewing
Linux Commands
File viewing and editing
emacs Full screen editor.
pico Simple text editor.
vi Editor with a command mode and text mode. Starts in
command mode.
gedit GUI Text Editor
tail Look at the last 10 lines of a file.
Ex: tail –f <filename> ,
Ex: tail -100 <filename>
head Look at the first 10 lines of a file. (head <filename>)
Linux File Management and Viewing
Linux Commands
File compression, backing up and restoring
compress Compress data.
uncompress Expand data.
gzip - zip a file to a gz file.
gunzip - unzip a gz file.
tar Archives files and directories. Can store files and
directories on tapes.
Ex: tar -zcvf <destination> <files/directories> - Archive
copy groups of files. tar –zxvf <compressed file> to
uncompress
zip – Compresses a file to a .zip file.
unzip – Uncompresses a file with .zip extension.
Linux File Management and Viewing
Linux Commands
cat View a file
Ex: cat filename
cmp Compare two files.
cut Remove sections from each line of files.
diff Show the differences between files.
Ex: diff file1 file2 : Find differences between file1 &
file2.
echo Display a line of text.
Linux File Management and Viewing
Linux Commands
grep List all files with the specified expression.
(grep pattern <filename/directorypath>)
Ex: ls –l |grep sidbi : List all lines with a sidbi in them.
Ex: grep " R " : Search for R with a space on each side
sleep Delay for a specified amount of time.
sort Sort a file alphabetically.
uniq Remove duplicate lines from a sorted file.
wc Count lines, words, characters in a file. (wc –c/w/l
<filename>).
This presentation is created using LibreOffice Writer 4.1.0.4
available freely under GNU public license.
Thank you

More Related Content

What's hot (20)

PDF
Useful Linux and Unix commands handbook
Wave Digitech
 
PPTX
Linux powerpoint
bijanshr
 
PPTX
Linux Shell Basics
Constantine Nosovsky
 
DOCX
BASIC COMMANDS OF LINUX
Mr.AKHILESH KUMAR {Computer Lab Technician}
 
PDF
Basic linux commands
Shakeel Shafiq
 
PDF
Complete Guide for Linux shell programming
sudhir singh yadav
 
PPTX
Terminal Commands (Linux - ubuntu) (part-1)
raj upadhyay
 
PPTX
Unix slideshare
Mohan Krishna Kona
 
PPTX
Basics of-linux
Singsys Pte Ltd
 
PDF
Basic commands
ambilivava
 
PDF
Quick Guide with Linux Command Line
Anuchit Chalothorn
 
PDF
50 most frequently used unix linux commands (with examples)
Rodrigo Maia
 
PPTX
system management -shell programming by gaurav raikar
GauravRaikar3
 
PDF
Unix Shell Script
student
 
PPT
Linux commands and file structure
Sreenatha Reddy K R
 
PDF
Unix Shell Scripting
Mustafa Qasim
 
PPTX
Linux basics
Geeta Vinnakota
 
PPTX
Linux command for beginners
SuKyeong Jang
 
PPTX
Linux commands
Mannu Khani
 
PDF
17 Linux Basics #burningkeyboards
Denis Ristic
 
Useful Linux and Unix commands handbook
Wave Digitech
 
Linux powerpoint
bijanshr
 
Linux Shell Basics
Constantine Nosovsky
 
Basic linux commands
Shakeel Shafiq
 
Complete Guide for Linux shell programming
sudhir singh yadav
 
Terminal Commands (Linux - ubuntu) (part-1)
raj upadhyay
 
Unix slideshare
Mohan Krishna Kona
 
Basics of-linux
Singsys Pte Ltd
 
Basic commands
ambilivava
 
Quick Guide with Linux Command Line
Anuchit Chalothorn
 
50 most frequently used unix linux commands (with examples)
Rodrigo Maia
 
system management -shell programming by gaurav raikar
GauravRaikar3
 
Unix Shell Script
student
 
Linux commands and file structure
Sreenatha Reddy K R
 
Unix Shell Scripting
Mustafa Qasim
 
Linux basics
Geeta Vinnakota
 
Linux command for beginners
SuKyeong Jang
 
Linux commands
Mannu Khani
 
17 Linux Basics #burningkeyboards
Denis Ristic
 

Viewers also liked (16)

PPT
Linux command ppt
kalyanineve
 
PDF
Intr fortran90
neetesh singh raghuvanshi
 
PDF
Open source applications softwares
Tushar B Kute
 
PDF
Module 1 introduction to Linux
Tushar B Kute
 
PDF
Linux fundamental - Chap 07 vi
Kenny (netman)
 
PDF
Importance of linux system fundamental in technical documentation reading
Kenny (netman)
 
ODP
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios
 
ODP
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios
 
PPT
Presentation on generation of languages
Richa Pant
 
PDF
Apache Pig: A big data processor
Tushar B Kute
 
PPTX
Why favour Icinga over Nagios - Rootconf 2015
Icinga
 
PPTX
Linux ppt
lincy21
 
ODP
An Introduction to Linux
anandvaidya
 
PPTX
Introduction to linux ppt
Omi Vichare
 
PPTX
Linux.ppt
onu9
 
PDF
Top 100 Linux Interview Questions and Answers 2014
iimjobs and hirist
 
Linux command ppt
kalyanineve
 
Open source applications softwares
Tushar B Kute
 
Module 1 introduction to Linux
Tushar B Kute
 
Linux fundamental - Chap 07 vi
Kenny (netman)
 
Importance of linux system fundamental in technical documentation reading
Kenny (netman)
 
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios
 
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios
 
Presentation on generation of languages
Richa Pant
 
Apache Pig: A big data processor
Tushar B Kute
 
Why favour Icinga over Nagios - Rootconf 2015
Icinga
 
Linux ppt
lincy21
 
An Introduction to Linux
anandvaidya
 
Introduction to linux ppt
Omi Vichare
 
Linux.ppt
onu9
 
Top 100 Linux Interview Questions and Answers 2014
iimjobs and hirist
 
Ad

Similar to Module 02 Using Linux Command Shell (20)

PPT
linux-lecture4.ppt
LuigysToro
 
PPT
linux-lecture4.pptuyhbjhbiibihbiuhbbihbi
YajnadattaPattanayak
 
PDF
Shell intro
Teja Bheemanapally
 
PPTX
Basic Linux Administration - 3.pptxon server
RekeshPatel
 
PPT
Shell_Scripting.ppt
KiranMantri
 
PDF
Shell intro
Srikanth Learner
 
PDF
Shell intro
Ankit Garg
 
PPTX
Unix Shell Script - 2 Days Session.pptx
Rajesh Kumar
 
PPT
PowerPoint_merge.ppt on unix programming
Priyadarshini648418
 
PDF
Unix and Linux - The simple introduction
Amity University Noida
 
DOC
58518522 study-aix
homeworkping3
 
PPTX
2. UNIX OS System Architecture easy.pptx
Priyadarshini648418
 
PPSX
Unix environment [autosaved]
Er Mittinpreet Singh
 
PPT
3. intro
Harsh Shrimal
 
PDF
Information about linux operating system
PriyankaMate4
 
PPTX
linux chapter 5.pptx lesson About introduction to linux
zakiaxmed534
 
DOCX
Directories description
Dr.M.Karthika parthasarathy
 
PPTX
Chapter 2 unix system commands
LukasJohnny
 
PPT
Unix fundamentals and_shell scripting
Ganesh Bhosale
 
PPTX
Commands and shell programming (3)
christ university
 
linux-lecture4.ppt
LuigysToro
 
linux-lecture4.pptuyhbjhbiibihbiuhbbihbi
YajnadattaPattanayak
 
Shell intro
Teja Bheemanapally
 
Basic Linux Administration - 3.pptxon server
RekeshPatel
 
Shell_Scripting.ppt
KiranMantri
 
Shell intro
Srikanth Learner
 
Shell intro
Ankit Garg
 
Unix Shell Script - 2 Days Session.pptx
Rajesh Kumar
 
PowerPoint_merge.ppt on unix programming
Priyadarshini648418
 
Unix and Linux - The simple introduction
Amity University Noida
 
58518522 study-aix
homeworkping3
 
2. UNIX OS System Architecture easy.pptx
Priyadarshini648418
 
Unix environment [autosaved]
Er Mittinpreet Singh
 
3. intro
Harsh Shrimal
 
Information about linux operating system
PriyankaMate4
 
linux chapter 5.pptx lesson About introduction to linux
zakiaxmed534
 
Directories description
Dr.M.Karthika parthasarathy
 
Chapter 2 unix system commands
LukasJohnny
 
Unix fundamentals and_shell scripting
Ganesh Bhosale
 
Commands and shell programming (3)
christ university
 
Ad

More from Tushar B Kute (20)

PDF
ॲलन ट्युरिंग: कृत्रिम बुद्धिमत्तेचा अग्रदूत - लेखक: तुषार भ. कुटे.pdf
Tushar B Kute
 
PDF
01 Introduction to Android
Tushar B Kute
 
PDF
Ubuntu OS and it's Flavours
Tushar B Kute
 
PDF
Install Drupal in Ubuntu by Tushar B. Kute
Tushar B Kute
 
PDF
Install Wordpress in Ubuntu Linux by Tushar B. Kute
Tushar B Kute
 
PDF
Share File easily between computers using sftp
Tushar B Kute
 
PDF
Signal Handling in Linux
Tushar B Kute
 
PDF
Implementation of FIFO in Linux
Tushar B Kute
 
PDF
Implementation of Pipe in Linux
Tushar B Kute
 
PDF
Basic Multithreading using Posix Threads
Tushar B Kute
 
PDF
Part 04 Creating a System Call in Linux
Tushar B Kute
 
PDF
Part 03 File System Implementation in Linux
Tushar B Kute
 
PDF
Part 02 Linux Kernel Module Programming
Tushar B Kute
 
PDF
Part 01 Linux Kernel Compilation (Ubuntu)
Tushar B Kute
 
PDF
Introduction to Ubuntu Edge Operating System (Ubuntu Touch)
Tushar B Kute
 
PDF
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Tushar B Kute
 
PDF
Technical blog by Engineering Students of Sandip Foundation, itsitrc
Tushar B Kute
 
PDF
Chapter 01 Introduction to Java by Tushar B Kute
Tushar B Kute
 
PDF
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Tushar B Kute
 
PDF
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Tushar B Kute
 
ॲलन ट्युरिंग: कृत्रिम बुद्धिमत्तेचा अग्रदूत - लेखक: तुषार भ. कुटे.pdf
Tushar B Kute
 
01 Introduction to Android
Tushar B Kute
 
Ubuntu OS and it's Flavours
Tushar B Kute
 
Install Drupal in Ubuntu by Tushar B. Kute
Tushar B Kute
 
Install Wordpress in Ubuntu Linux by Tushar B. Kute
Tushar B Kute
 
Share File easily between computers using sftp
Tushar B Kute
 
Signal Handling in Linux
Tushar B Kute
 
Implementation of FIFO in Linux
Tushar B Kute
 
Implementation of Pipe in Linux
Tushar B Kute
 
Basic Multithreading using Posix Threads
Tushar B Kute
 
Part 04 Creating a System Call in Linux
Tushar B Kute
 
Part 03 File System Implementation in Linux
Tushar B Kute
 
Part 02 Linux Kernel Module Programming
Tushar B Kute
 
Part 01 Linux Kernel Compilation (Ubuntu)
Tushar B Kute
 
Introduction to Ubuntu Edge Operating System (Ubuntu Touch)
Tushar B Kute
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Tushar B Kute
 
Technical blog by Engineering Students of Sandip Foundation, itsitrc
Tushar B Kute
 
Chapter 01 Introduction to Java by Tushar B Kute
Tushar B Kute
 
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Tushar B Kute
 
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Tushar B Kute
 

Recently uploaded (20)

PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PPTX
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
 
PDF
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
DOCX
Import Data Form Excel to Tally Services
Tally xperts
 
PPTX
How Odoo Became a Game-Changer for an IT Company in Manufacturing ERP
SatishKumar2651
 
PPTX
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
PDF
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
PPTX
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
PDF
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
PDF
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
PPTX
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
 
PPTX
Engineering the Java Web Application (MVC)
abhishekoza1981
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PPTX
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PPTX
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
 
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Import Data Form Excel to Tally Services
Tally xperts
 
How Odoo Became a Game-Changer for an IT Company in Manufacturing ERP
SatishKumar2651
 
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
 
Engineering the Java Web Application (MVC)
abhishekoza1981
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
Human Resources Information System (HRIS)
Amity University, Patna
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 

Module 02 Using Linux Command Shell

  • 1. Module-2 Using Linux Command Shell Tushar B Kute [email protected] http://snashlug.org [email protected]
  • 2. UNIX Commands Linux Commands A command is a program which interacts with the kernel to provide the environment and perform the functions called for by the user. A command can be: a built-in shell command; an executable shell file, known as a shell script; or a source compiled, object code file. The shell is a command line interpreter. The user interacts with the kernel through the shell. You can write ASCII (text) scripts to be acted upon by a shell.
  • 3. UNIX Shell The shell sits between you and the operating system, acting as a command interpreter. It reads your terminal input and translates the commands into actions taken by the system. The shell is analogous to command.com in DOS. When you log into the system you are given a default shell. When the shell starts up it reads its startup files and may set environment variables, command search paths, and command aliases, and executes any commands specified in these files.
  • 4. UNIX Shell Linux Commands The original shell was the Bourne shell, sh. Every Unix platform will either have the Bourne shell, or a Bourne compatible shell available. The default prompt for the Bourne shell is $ (or #, for the root user). Another popular shell is C Shell. The default prompt for the C shell is %.
  • 5. UNIX Shell Linux Commands Numerous other shells are available from the network. Almost all of them are based on either sh or csh with extensions to provide job control to sh, allow in-line editing of commands, page through previously executed commands, provide command name completion and custom prompt, etc. Some of the more well known of these may be on your favorite Unix system: the Korn shell, ksh, by David Korn and the Bourne Again SHell, bash, from the Free Software Foundations GNU project, both based on sh, the T-C shell, tcsh, and the extended C shell, cshe, both based on csh.
  • 6. LINUX COMMANDS Linux Commands File Management and Viewing File-system Management Help, Job and Process Management Network Management System Management User Management Printing and Programming Document Preparation Miscellaneous
  • 7. Command Structure Linux Commands Command <Options> <Arguments> Multiple commands separated by ; can be executed one after the other
  • 8. Help Facilities for Commands Linux Commands To understand the working of the command and possible options use (man command) Using the GNU Info System (info, info command) Listing a Description of a Program (whatis command) Many tools have a long−style option, `−−help', that outputs usage information about the tool, including the options and arguments the tool takes. Ex: whoami --help
  • 9. Pipes Linux Commands An important early development in Unix was the invention of "pipes," a way to pass the output of one tool to the input of another. eg. $ who | wc −l By combining these two tools, giving the wc command the output of who, you can build a new command to list the number of users currently on the system
  • 10. Linux File Management and Viewing Linux Commands File and Directory management cd Change the current directory. With no arguments "cd" changes to the users home directory. (cd <directory path>) chmod Change the file permissions. Ex: chmod 751 myfile : change the file permissions to rwx for owner, rx for group and x for others Ex: chmod +r myfile chmod -w myfile
  • 11. Linux File Management and Viewing Linux Commands chown Change owner. Ex: chown <owner1> <filename> : Change ownership of a file to owner1. chgrp Change group. Ex: chgrp <group1> <filename> : Change group of a file to group1. cp Copy a file from one location to another. Ex: cp file1 file2 : Copy file1 to file2 Ex: cp –R dir1 dir2 : Copy dir1 to dir2
  • 12. Linux File Management and Viewing Linux Commands ls List contents of a directory. Ex: ls, ls –l , ls –al, ls –ld, ls –R (-rwxrwxr-x 1 juan juan 0 Sep 26 12:25 foo ) |more will list page wise mkdir Make a directory. Ex: mkdir <directory name> : Makes a directory Ex mkdir –p /www/chache/var/log will create all the directories starting from www. mv Move or rename a file or directory. Ex: mv <source> <destination>
  • 13. Linux File Management and Viewing Linux Commands find Find files (find <start directory> -name <file name> -print) Ex: find /home –name readme -print (Search for readme starting at home and output full path.) “/home" = Search starting at the home directory and proceed through all its subdirectories "-name readme" = Search for a file named readme "-print" = Output the full path to that file locate File locating program that uses the slocate database. Ex: locate –u to create the database, locate <file/directory> to find file/directory Wild card characters?
  • 14. Linux File Management and Viewing Linux Commands pwd Print or list the present working directory with full path. rm Delete files (Remove files). (rm –rf <directory/file>) rmdir Remove a directory. The directory must be empty. (rmdir <directory>) touch Change file timestamps to the current time. Make the file if it doesn't exist. (touch <filename>) whereis Locate the binary and man page files for a command. (whereis <program/command>) which Show full path of commands where given commands reside. (which <command>)
  • 15. Linux File Management and Viewing Linux Commands File viewing and editing emacs Full screen editor. pico Simple text editor. vi Editor with a command mode and text mode. Starts in command mode. gedit GUI Text Editor tail Look at the last 10 lines of a file. Ex: tail –f <filename> , Ex: tail -100 <filename> head Look at the first 10 lines of a file. (head <filename>)
  • 16. Linux File Management and Viewing Linux Commands File compression, backing up and restoring compress Compress data. uncompress Expand data. gzip - zip a file to a gz file. gunzip - unzip a gz file. tar Archives files and directories. Can store files and directories on tapes. Ex: tar -zcvf <destination> <files/directories> - Archive copy groups of files. tar –zxvf <compressed file> to uncompress zip – Compresses a file to a .zip file. unzip – Uncompresses a file with .zip extension.
  • 17. Linux File Management and Viewing Linux Commands cat View a file Ex: cat filename cmp Compare two files. cut Remove sections from each line of files. diff Show the differences between files. Ex: diff file1 file2 : Find differences between file1 & file2. echo Display a line of text.
  • 18. Linux File Management and Viewing Linux Commands grep List all files with the specified expression. (grep pattern <filename/directorypath>) Ex: ls –l |grep sidbi : List all lines with a sidbi in them. Ex: grep " R " : Search for R with a space on each side sleep Delay for a specified amount of time. sort Sort a file alphabetically. uniq Remove duplicate lines from a sorted file. wc Count lines, words, characters in a file. (wc –c/w/l <filename>).
  • 19. This presentation is created using LibreOffice Writer 4.1.0.4 available freely under GNU public license. Thank you