SlideShare a Scribd company logo
Linux Commands


   Prepared By Santosh Sharma
There are of course thousands of Linux related commands and procedures.

cd
This command is used to change the directory and using this command will change
your location to what ever directory you specify


cd hello
will change to the directory named hello located inside the current directory


cd /home/games
will change to the directory called games within the home directory.
As you can see you can specify any directory on the Linux system and change to
that directory from any other directory.
ls
The ls command lists the contents of a directory. In its simple form typing just ls at
the command prompt will give a listing for the directory you are currently in. The ls
command can also give listings of other directories without having to go to those
directories for example typing ls /dev/bin will display the listing for the directory
/dev/bin .
ls -a This will list all file including those beginning with the'.' that would normally be
hidden from view.

ls -l This gives a long listing showing file attributes and file permissions.

ls -s Will display the listing showing the size of each file rounded up to the nearest
kilobyte.

ls -S This will list the files according to file size.

ls -C Gives the listing display in columns.

ls -r Gives the listing in reverse order.

ls -t Lists the directory according to time stamps.
Switches can be combined to produce any output you desire.
e.g.
ls -la
This will list all the files in long format showing full file details.

mkdir
The mkdir command is used to create a new directory.


mkdir mydir
This will make a directory (actually a sub directory) within the current directory
called mydir.


pwd
The pwd command (print working directory) will display the current directory.
e.g.
typing
pwd
will display something similar to this /home/games/help
being the details of the current directory.
rm
The rm command is used to delete files.
rm myfile
This will delete the file called mydir. You can include a path to delete a file in
another directory for example rm /home/hello/goodbye.htm will delete the file
named goodbye.htm in the directory /home/hello/.


Some of the common switches for the rm command are

rm -i this operates the rm command in interactive mode meaning it will prompt you
before deleting a file. This gives you a second chance to say no do not delete the
file or yes delete the file. Remember Linux is merciless and once something is
deleted it is gone for good so the -i flag (switch) is a good one to get into the habit
of using.
rmdir
The rmdir command is used to delete a directory.


rmdir mydir
This will delete the directory (actually a sub directory) called mydir.

tree
This will give a graphical display of the structure of a particular directory and all sub
directories, files and links within that directory.
e.g.
tree /var/lib
will show something similar to this
/var/lib
|--games
|--rpm
| |--conflictsindex.rpm
| |--fileindex.rpm
| |--groupsindex.rpm
| |--packages.rpm
| `--require.rpm
`--text
6 directories, 6 files
cp
The cp command copies files. You can copy a file in within the current directory or
you can copy files to another directory.
cp myfile.html /home/help/mynewname.html
This will copy the file called myfile.html in the current directory to the directory /home/
help/ and call it mynewname.html.
imply put the cp command has the format of
cp file1 file2 With file1 being the name (including the path if needed) of the file being
copied and file2 is the name (including the path if needed) of the new file being
created.
Remember with the cp command the original file remains in place.

find
The find command is used to find files and or folders within a Linux
system.
To find a file using the find command you type
find /usr/bin -name filename
this will search inside the /usr/bin directory (and any sub directories within
the /usr/bin directory) for the file named filename. To search the entire filing
system including any mounted drives use
find / -name filename
and the find command will search every file system beginning in the root
directory.
more
This command allows you too scroll through a file one screen at a time
allowing you to more easily read the files contents. Some files are very big
and using this command allows you to view the contents of large files
more efficiently. To go forward one screen use the space bar and to go
back one screen use the B key
more filename


less
This command allows you to scroll through a file a page at a time. The
less command is very similar to the more command only it is more
advanced and has more features associated with it.
less filename

vi
The vi command is actually a text editor that comes as standard with most
Linux packages.
ps
The ps (process status) will by default only show the processes that you
as a user have started. However Linux is always running background
tasks so you may want to use some of the common switches associated
with the ps such as ps au to display the processes running for all users
and in the user format hence we get to see every process that is running
on the system.
When a process is started it is given among other things a PID number
that is unique to it. This PID number can be seen by using the ps
command or top command. By knowing a Process ID number you may
opt to kill the process if you choose.

kill
The kill command is used to kill a process by using the associated PID
(Process ID) number
e.g.
kill 381
This will kill the process with the PID of 381. Be careful using the kill
command because it is easy to accidently kill an important process.

More Related Content

What's hot

One Page Linux Manual
One Page Linux ManualOne Page Linux Manual
One Page Linux Manual
dummy
 
Unix slideshare
Unix slideshareUnix slideshare
Unix slideshare
Mohan Krishna Kona
 
Basic Linux commands
Basic Linux commandsBasic Linux commands
Basic Linux commands
atozknowledge .com
 
Basic linux commands
Basic linux commands Basic linux commands
Basic linux commands
Raghav Arora
 
Linux cheat-sheet
Linux cheat-sheetLinux cheat-sheet
Linux cheat-sheet
Craig Cannon
 
Linux command for beginners
Linux command for beginnersLinux command for beginners
Linux command for beginners
SuKyeong Jang
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editor
shanmuga rajan
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
Harikrishnan Ramakrishnan
 
[PDF] 2021 Termux basic commands list
[PDF] 2021 Termux basic commands list [PDF] 2021 Termux basic commands list
[PDF] 2021 Termux basic commands list
nisivaasdfghj
 
50 most frequently used unix linux commands (with examples)
50 most frequently used unix   linux commands (with examples)50 most frequently used unix   linux commands (with examples)
50 most frequently used unix linux commands (with examples)
Rodrigo Maia
 
BASIC COMMANDS OF LINUX
BASIC COMMANDS OF LINUXBASIC COMMANDS OF LINUX
Rpm Introduction
Rpm IntroductionRpm Introduction
Rpm Introduction
Shrinivasan T
 
Unix / Linux Command Reference
Unix / Linux Command ReferenceUnix / Linux Command Reference
Unix / Linux Command Reference
Sumankumar Panchal
 
40 basic linux command
40 basic linux command40 basic linux command
40 basic linux command
Teja Bheemanapally
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
Utkarsh Sengar
 
Linux Bash Shell Cheat Sheet for Beginners
Linux Bash Shell Cheat Sheet for BeginnersLinux Bash Shell Cheat Sheet for Beginners
Linux Bash Shell Cheat Sheet for Beginners
Davide Ciambelli
 
Termux commands-list
Termux commands-listTermux commands-list
Termux commands-list
DhanushR24
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commands
swtjerin4u
 
Linux basics
Linux basicsLinux basics
Linux basics
BhaskarNeeluru
 

What's hot (19)

One Page Linux Manual
One Page Linux ManualOne Page Linux Manual
One Page Linux Manual
 
Unix slideshare
Unix slideshareUnix slideshare
Unix slideshare
 
Basic Linux commands
Basic Linux commandsBasic Linux commands
Basic Linux commands
 
Basic linux commands
Basic linux commands Basic linux commands
Basic linux commands
 
Linux cheat-sheet
Linux cheat-sheetLinux cheat-sheet
Linux cheat-sheet
 
Linux command for beginners
Linux command for beginnersLinux command for beginners
Linux command for beginners
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editor
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
[PDF] 2021 Termux basic commands list
[PDF] 2021 Termux basic commands list [PDF] 2021 Termux basic commands list
[PDF] 2021 Termux basic commands list
 
50 most frequently used unix linux commands (with examples)
50 most frequently used unix   linux commands (with examples)50 most frequently used unix   linux commands (with examples)
50 most frequently used unix linux commands (with examples)
 
BASIC COMMANDS OF LINUX
BASIC COMMANDS OF LINUXBASIC COMMANDS OF LINUX
BASIC COMMANDS OF LINUX
 
Rpm Introduction
Rpm IntroductionRpm Introduction
Rpm Introduction
 
Unix / Linux Command Reference
Unix / Linux Command ReferenceUnix / Linux Command Reference
Unix / Linux Command Reference
 
40 basic linux command
40 basic linux command40 basic linux command
40 basic linux command
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 
Linux Bash Shell Cheat Sheet for Beginners
Linux Bash Shell Cheat Sheet for BeginnersLinux Bash Shell Cheat Sheet for Beginners
Linux Bash Shell Cheat Sheet for Beginners
 
Termux commands-list
Termux commands-listTermux commands-list
Termux commands-list
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commands
 
Linux basics
Linux basicsLinux basics
Linux basics
 

Similar to Linux commands

Linux presentation
Linux presentationLinux presentation
Linux presentation
Nikhil Jain
 
The structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformaticsThe structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformatics
BITS
 
Linux_Commands.pdf
Linux_Commands.pdfLinux_Commands.pdf
Linux_Commands.pdf
MarsMox
 
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.ppt
LuigysToro
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
Sreenatha Reddy K R
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
Muhammad Qazi
 
Directories description
Directories descriptionDirectories description
Directories description
Dr.M.Karthika parthasarathy
 
Linux ppt
Linux pptLinux ppt
Linux ppt
Sanmuga Nathan
 
Linux file system nevigation
Linux file system nevigationLinux file system nevigation
Linux file system nevigation
hetaldobariya
 
Operating system lab manual
Operating system lab manualOperating system lab manual
Operating system lab manual
Meerut Institute of Technology
 
OS Lab Manual.pdf
OS Lab Manual.pdfOS Lab Manual.pdf
OS Lab Manual.pdf
QucHunh15
 
Assignment OS LAB 2022
Assignment OS LAB 2022Assignment OS LAB 2022
Assignment OS LAB 2022
INFOTAINMENTCHANNEL1
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
MohanKumar Palanichamy
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
southees
 
Unix Basics For Testers
Unix Basics For TestersUnix Basics For Testers
Unix Basics For Testers
nitin lakhanpal
 
linux commands.pdf
linux commands.pdflinux commands.pdf
linux commands.pdf
amitkamble79
 
Basic shell commands by Jeremy Sanders
Basic shell commands by Jeremy SandersBasic shell commands by Jeremy Sanders
Basic shell commands by Jeremy Sanders
Devanand Gehlot
 
Linux directory commands:more options on cd and ls command
Linux directory commands:more options on cd and ls commandLinux directory commands:more options on cd and ls command
Linux directory commands:more options on cd and ls command
bhatvijetha
 
Linux cheat sheet
Linux cheat sheetLinux cheat sheet
Linux cheat sheet
Dimitris Kyrgiafinis
 
Linux week 2
Linux week 2Linux week 2
Linux week 2
Vinoth Sn
 

Similar to Linux commands (20)

Linux presentation
Linux presentationLinux presentation
Linux presentation
 
The structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformaticsThe structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformatics
 
Linux_Commands.pdf
Linux_Commands.pdfLinux_Commands.pdf
Linux_Commands.pdf
 
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.ppt
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Directories description
Directories descriptionDirectories description
Directories description
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Linux file system nevigation
Linux file system nevigationLinux file system nevigation
Linux file system nevigation
 
Operating system lab manual
Operating system lab manualOperating system lab manual
Operating system lab manual
 
OS Lab Manual.pdf
OS Lab Manual.pdfOS Lab Manual.pdf
OS Lab Manual.pdf
 
Assignment OS LAB 2022
Assignment OS LAB 2022Assignment OS LAB 2022
Assignment OS LAB 2022
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
 
Unix Basics For Testers
Unix Basics For TestersUnix Basics For Testers
Unix Basics For Testers
 
linux commands.pdf
linux commands.pdflinux commands.pdf
linux commands.pdf
 
Basic shell commands by Jeremy Sanders
Basic shell commands by Jeremy SandersBasic shell commands by Jeremy Sanders
Basic shell commands by Jeremy Sanders
 
Linux directory commands:more options on cd and ls command
Linux directory commands:more options on cd and ls commandLinux directory commands:more options on cd and ls command
Linux directory commands:more options on cd and ls command
 
Linux cheat sheet
Linux cheat sheetLinux cheat sheet
Linux cheat sheet
 
Linux week 2
Linux week 2Linux week 2
Linux week 2
 

Recently uploaded

Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 

Recently uploaded (20)

Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 

Linux commands

  • 1. Linux Commands Prepared By Santosh Sharma
  • 2. There are of course thousands of Linux related commands and procedures. cd This command is used to change the directory and using this command will change your location to what ever directory you specify cd hello will change to the directory named hello located inside the current directory cd /home/games will change to the directory called games within the home directory. As you can see you can specify any directory on the Linux system and change to that directory from any other directory. ls The ls command lists the contents of a directory. In its simple form typing just ls at the command prompt will give a listing for the directory you are currently in. The ls command can also give listings of other directories without having to go to those directories for example typing ls /dev/bin will display the listing for the directory /dev/bin .
  • 3. ls -a This will list all file including those beginning with the'.' that would normally be hidden from view. ls -l This gives a long listing showing file attributes and file permissions. ls -s Will display the listing showing the size of each file rounded up to the nearest kilobyte. ls -S This will list the files according to file size. ls -C Gives the listing display in columns. ls -r Gives the listing in reverse order. ls -t Lists the directory according to time stamps.
  • 4. Switches can be combined to produce any output you desire. e.g. ls -la This will list all the files in long format showing full file details. mkdir The mkdir command is used to create a new directory. mkdir mydir This will make a directory (actually a sub directory) within the current directory called mydir. pwd The pwd command (print working directory) will display the current directory. e.g. typing pwd will display something similar to this /home/games/help being the details of the current directory.
  • 5. rm The rm command is used to delete files. rm myfile This will delete the file called mydir. You can include a path to delete a file in another directory for example rm /home/hello/goodbye.htm will delete the file named goodbye.htm in the directory /home/hello/. Some of the common switches for the rm command are rm -i this operates the rm command in interactive mode meaning it will prompt you before deleting a file. This gives you a second chance to say no do not delete the file or yes delete the file. Remember Linux is merciless and once something is deleted it is gone for good so the -i flag (switch) is a good one to get into the habit of using.
  • 6. rmdir The rmdir command is used to delete a directory. rmdir mydir This will delete the directory (actually a sub directory) called mydir. tree This will give a graphical display of the structure of a particular directory and all sub directories, files and links within that directory. e.g. tree /var/lib will show something similar to this /var/lib |--games |--rpm | |--conflictsindex.rpm | |--fileindex.rpm | |--groupsindex.rpm | |--packages.rpm | `--require.rpm `--text 6 directories, 6 files
  • 7. cp The cp command copies files. You can copy a file in within the current directory or you can copy files to another directory. cp myfile.html /home/help/mynewname.html This will copy the file called myfile.html in the current directory to the directory /home/ help/ and call it mynewname.html. imply put the cp command has the format of cp file1 file2 With file1 being the name (including the path if needed) of the file being copied and file2 is the name (including the path if needed) of the new file being created. Remember with the cp command the original file remains in place. find The find command is used to find files and or folders within a Linux system. To find a file using the find command you type find /usr/bin -name filename this will search inside the /usr/bin directory (and any sub directories within the /usr/bin directory) for the file named filename. To search the entire filing system including any mounted drives use find / -name filename and the find command will search every file system beginning in the root directory.
  • 8. more This command allows you too scroll through a file one screen at a time allowing you to more easily read the files contents. Some files are very big and using this command allows you to view the contents of large files more efficiently. To go forward one screen use the space bar and to go back one screen use the B key more filename less This command allows you to scroll through a file a page at a time. The less command is very similar to the more command only it is more advanced and has more features associated with it. less filename vi The vi command is actually a text editor that comes as standard with most Linux packages.
  • 9. ps The ps (process status) will by default only show the processes that you as a user have started. However Linux is always running background tasks so you may want to use some of the common switches associated with the ps such as ps au to display the processes running for all users and in the user format hence we get to see every process that is running on the system. When a process is started it is given among other things a PID number that is unique to it. This PID number can be seen by using the ps command or top command. By knowing a Process ID number you may opt to kill the process if you choose. kill The kill command is used to kill a process by using the associated PID (Process ID) number e.g. kill 381 This will kill the process with the PID of 381. Be careful using the kill command because it is easy to accidently kill an important process.