SlideShare a Scribd company logo
1 of 7
Linux Commands
File Commands
1.
2.
3.
4.
5.
6.
7.
8.
9.
ls
ls -al
ls -lt
cd dir
cd
pwd
mkdir dir
cat >file
more file
Directory listing
Formatted listing with hidden files
Sorting the Formatted listing by time modification
Change directory to dir
Change to home directory
Show current working directory
Creating a directory dir
Places the standard input into the file
Output the contents of the file
Output the first 10 lines of the file
Output the last 10 lines of the file
Output the contents of file as it grows,starting with
the last 10 lines
Create or update file
Deleting the file
Deleting the directory
Force to remove the file
Force to remove the directory dir
Copy the contents of file1 to file2
Copy dir1 to dir2;create dir2 if not present
Rename or move file1 to file2,if file2 is an existing
directory
Create symbolic link link to file
10. head file
11. tail file
12. tail -f file
13. touch file
14. rm file
15. rm -r dir
16. rm -f file
17. rm -rf dir
18. cp file1 file2
19. cp -r dir1 dir2
20. mv file1 file2
21. ln -s file link
Process management
1.
2.
ps
top
To display the currently working processes
Display all running process
SHIVA BHARDWAJ
SHIVA BHARDWAJ
3.
4.
5.
6.
7.
8.
kill pid
killall proc
pkill pattern
bg
fg
fg n
Kill the process with given pid
Kill all the process named proc
Will kill all processes matching the pattern
List stopped or background jobs,resume a stopped
job in the background
Brings the most recent job to foreground
Brings job n to the foreground
File permission
1. chmod octal file Change the permission of file to octal,which can
be found separately for user,group,world by
adding,
•4-read(r)
•2-write(w)
•1-execute(x)
Searching
1.
2.
3.
4.
5.
grep pattern file
grep -r pattern dir
command | grep
pattern
locate file
find . -name filename
Search for pattern in file
Search recursively for pattern in dir
Search pattern in the output of a command
Find all instances of file
Searches in the current directory (represented by
a period) and below it, for files and directories with
names starting with filename
Searches for all the named processes , that
matches with the pattern and, by default, returns
their ID
6. pgrep pattern
System Info
1.
2.
3.
4.
5.
date
cal
uptime
w
whoami
Show the current date and time
Show this month's calender
Show current uptime
Display who is on line
Who you are logged in as
SHIVA BHARDWAJ
6.
7.
8.
9.
finger user
uname -a
cat /proc/cpuinfo
cat proc/meminfo
Display information about user
Show kernel information
Cpu information
Memory information
Show the manual for command
Show the disk usage
Show directory space usage
Show memory and swap usage
Show possible locations of app
Show which applications will be run by default
10. man command
11. df
12. du
13. free
14. whereis app
15. which app
Compression
1.
2.
3.
4.
5.
6.
7.
8.
tar cf file.tar file
tar xf file.tar
tar czf file.tar.gz files
tar xzf file.tar.gz
tar cjf file.tar.bz2
tar xjf file.tar.bz2
gzip file
gzip -d file.gz
Create tar named file.tar containing file
Extract the files from file.tar
Create a tar with Gzip compression
Extract a tar using Gzip
Create tar with Bzip2 compression
Extract a tar using Bzip2
Compresses file and renames it to file.gz
Decompresses file.gz back to file
Network
1.
2.
3.
4.
5.
6.
ping host
whois domain
dig domain
dig -x host
wget file
wget -c file
Ping host and output results
Get whois information for domains
Get DNS information for domain
Reverse lookup host
Download file
Continue a stopped download
SHIVA BHARDWAJ
Shortcuts
1.
2.
3.
4.
5.
6.
7.
8.
ctrl+c
ctrl+z
ctrl+d
ctrl+w
ctrl+u
ctrl+r
!!
exit
Halts the current command
Stops the current command, resume with fg in the
foreground or bg in the background
Logout the current session, similar to exit
Erases one word in the current line
Erases the whole line
Type to bring up a recent command
Repeats the last command
Logout the current session

More Related Content

What's hot (18)

Linux commands
Linux commandsLinux commands
Linux commands
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Basic commands of linux
Basic commands of linuxBasic commands of linux
Basic commands of linux
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Red Hat Linux cheat sheet
Red Hat Linux cheat sheetRed Hat Linux cheat sheet
Red Hat Linux cheat sheet
 
Basic
BasicBasic
Basic
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commands
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Know the UNIX Commands
Know the UNIX CommandsKnow the UNIX Commands
Know the UNIX Commands
 
Anandha ganesh linux1.ppt
Anandha ganesh linux1.pptAnandha ganesh linux1.ppt
Anandha ganesh linux1.ppt
 
Unix made easy
Unix made easyUnix made easy
Unix made easy
 
Basic Linux day 2
Basic Linux day 2Basic Linux day 2
Basic Linux day 2
 
Bind How To
Bind How ToBind How To
Bind How To
 
BIND DNS Configuration Red Hat 5
BIND DNS Configuration Red Hat 5BIND DNS Configuration Red Hat 5
BIND DNS Configuration Red Hat 5
 

Viewers also liked

industrial psychology 2
industrial psychology 2industrial psychology 2
industrial psychology 2Shiva Bhardwaj
 
Industrial psychology by_pawan_tripathi_e_book___2014_09_07_15_23_42_168
Industrial psychology by_pawan_tripathi_e_book___2014_09_07_15_23_42_168Industrial psychology by_pawan_tripathi_e_book___2014_09_07_15_23_42_168
Industrial psychology by_pawan_tripathi_e_book___2014_09_07_15_23_42_168Pawan Tripathi
 
Industrial/ Organisational Psychology
Industrial/ Organisational PsychologyIndustrial/ Organisational Psychology
Industrial/ Organisational PsychologyMuhammad Abdullah
 

Viewers also liked (7)

LINUX
LINUX LINUX
LINUX
 
industrial psychology 2
industrial psychology 2industrial psychology 2
industrial psychology 2
 
Industrial psychology
Industrial   psychologyIndustrial   psychology
Industrial psychology
 
Industrial psychology by_pawan_tripathi_e_book___2014_09_07_15_23_42_168
Industrial psychology by_pawan_tripathi_e_book___2014_09_07_15_23_42_168Industrial psychology by_pawan_tripathi_e_book___2014_09_07_15_23_42_168
Industrial psychology by_pawan_tripathi_e_book___2014_09_07_15_23_42_168
 
Industrial/ Organisational Psychology
Industrial/ Organisational PsychologyIndustrial/ Organisational Psychology
Industrial/ Organisational Psychology
 
Industrial Psychology
Industrial PsychologyIndustrial Psychology
Industrial Psychology
 
Leach
Leach Leach
Leach
 

Similar to Linux commands

Similar to Linux commands (20)

Linuxcommands
LinuxcommandsLinuxcommands
Linuxcommands
 
some title
some titlesome title
some title
 
linuxcommands.pdf
linuxcommands.pdflinuxcommands.pdf
linuxcommands.pdf
 
Basic Linux Commands.pptx
Basic Linux Commands.pptxBasic Linux Commands.pptx
Basic Linux Commands.pptx
 
Introduction to linux day1
Introduction to linux day1Introduction to linux day1
Introduction to linux day1
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
3.1.a linux commands reference
3.1.a linux commands reference3.1.a linux commands reference
3.1.a linux commands reference
 
Unix Basics For Testers
Unix Basics For TestersUnix Basics For Testers
Unix Basics For Testers
 
Management file and directory in linux
Management file and directory in linuxManagement file and directory in linux
Management file and directory in linux
 
14.Linux Command
14.Linux Command14.Linux Command
14.Linux Command
 
Introduction to linux2
Introduction to linux2Introduction to linux2
Introduction to linux2
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Linux file system nevigation
Linux file system nevigationLinux file system nevigation
Linux file system nevigation
 
Directories description
Directories descriptionDirectories description
Directories description
 
Unit 7
Unit 7Unit 7
Unit 7
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
 
The one page linux manual
The one page linux manualThe one page linux manual
The one page linux manual
 
The one page linux manual
The one page linux manualThe one page linux manual
The one page linux manual
 
linux commands.pdf
linux commands.pdflinux commands.pdf
linux commands.pdf
 
linux-file-system01.ppt
linux-file-system01.pptlinux-file-system01.ppt
linux-file-system01.ppt
 

Recently uploaded

ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 

Linux commands

  • 1.
  • 2. Linux Commands File Commands 1. 2. 3. 4. 5. 6. 7. 8. 9. ls ls -al ls -lt cd dir cd pwd mkdir dir cat >file more file Directory listing Formatted listing with hidden files Sorting the Formatted listing by time modification Change directory to dir Change to home directory Show current working directory Creating a directory dir Places the standard input into the file Output the contents of the file Output the first 10 lines of the file Output the last 10 lines of the file Output the contents of file as it grows,starting with the last 10 lines Create or update file Deleting the file Deleting the directory Force to remove the file Force to remove the directory dir Copy the contents of file1 to file2 Copy dir1 to dir2;create dir2 if not present Rename or move file1 to file2,if file2 is an existing directory Create symbolic link link to file 10. head file 11. tail file 12. tail -f file 13. touch file 14. rm file 15. rm -r dir 16. rm -f file 17. rm -rf dir 18. cp file1 file2 19. cp -r dir1 dir2 20. mv file1 file2 21. ln -s file link Process management 1. 2. ps top To display the currently working processes Display all running process
  • 3. SHIVA BHARDWAJ SHIVA BHARDWAJ 3. 4. 5. 6. 7. 8. kill pid killall proc pkill pattern bg fg fg n Kill the process with given pid Kill all the process named proc Will kill all processes matching the pattern List stopped or background jobs,resume a stopped job in the background Brings the most recent job to foreground Brings job n to the foreground File permission 1. chmod octal file Change the permission of file to octal,which can be found separately for user,group,world by adding, •4-read(r) •2-write(w) •1-execute(x) Searching 1. 2. 3. 4. 5. grep pattern file grep -r pattern dir command | grep pattern locate file find . -name filename Search for pattern in file Search recursively for pattern in dir Search pattern in the output of a command Find all instances of file Searches in the current directory (represented by a period) and below it, for files and directories with names starting with filename Searches for all the named processes , that matches with the pattern and, by default, returns their ID 6. pgrep pattern System Info 1. 2. 3. 4. 5. date cal uptime w whoami Show the current date and time Show this month's calender Show current uptime Display who is on line Who you are logged in as
  • 4.
  • 5. SHIVA BHARDWAJ 6. 7. 8. 9. finger user uname -a cat /proc/cpuinfo cat proc/meminfo Display information about user Show kernel information Cpu information Memory information Show the manual for command Show the disk usage Show directory space usage Show memory and swap usage Show possible locations of app Show which applications will be run by default 10. man command 11. df 12. du 13. free 14. whereis app 15. which app Compression 1. 2. 3. 4. 5. 6. 7. 8. tar cf file.tar file tar xf file.tar tar czf file.tar.gz files tar xzf file.tar.gz tar cjf file.tar.bz2 tar xjf file.tar.bz2 gzip file gzip -d file.gz Create tar named file.tar containing file Extract the files from file.tar Create a tar with Gzip compression Extract a tar using Gzip Create tar with Bzip2 compression Extract a tar using Bzip2 Compresses file and renames it to file.gz Decompresses file.gz back to file Network 1. 2. 3. 4. 5. 6. ping host whois domain dig domain dig -x host wget file wget -c file Ping host and output results Get whois information for domains Get DNS information for domain Reverse lookup host Download file Continue a stopped download
  • 6.
  • 7. SHIVA BHARDWAJ Shortcuts 1. 2. 3. 4. 5. 6. 7. 8. ctrl+c ctrl+z ctrl+d ctrl+w ctrl+u ctrl+r !! exit Halts the current command Stops the current command, resume with fg in the foreground or bg in the background Logout the current session, similar to exit Erases one word in the current line Erases the whole line Type to bring up a recent command Repeats the last command Logout the current session