SlideShare a Scribd company logo
1 of 32
Download to read offline
BASIC LINUX 
COMMANDS 
Welcome to the Linux World
What are linux commands 
Linux commands are just simple programs like 
a program in windows. Typing command is like 
clicking an icon in windows. 
Sometimes commands take some extra 
parameters to do extra work, we call them 
flags.
man (Your best friend!) 
man means manual pages, its like reading a 
manual of any home appliance. In software it 
means reading documentation. Good softwares 
have always a good documentation part. 
$ man <command> 
$ man clear
ls (list items) 
● The ls command ( lowercase L and 
lowercase S ) lists the contents of your 
current working directory. 
● ls by default does not show hidden 
files 
● to see all files use ls -al 
● -al is flag in this case
mkdir (make directory) 
● creates a directory 
● use -p to create as many directories. 
● $ mkdir first/second/third -p 
● $ cd first/second/third
cd (change directory) 
● changes the current directory 
● cd . to remain inside same directory 
● cd .. to go back one directory
pwd (print working directory) 
For example, to find out the absolute pathname 
of your home-directory, type cd to get back to 
your home-directory and then type 
$ pwd 
it will print current directory
~ Your Home Directory 
By typing cd ~ in terminal it will take you to the 
home directory of current user 
$ cd ~
cp (copy) 
copies a file or entire directory to another path 
If you want to copy files from another directory 
to current directory use a . for destination 
$ cp <source_file> <destination_file> 
Tip: Always read the error carefully and please 
don't freak out :)
mv (move file) 
move command renames or move a file 
use -r flag to recursively move all files 
$ mv file1.txt file2.txt
rm (remove) 
rm removes a file or entire directory with -r flag 
$ rm <file> 
$ rm <directory> -r
clear 
clears your screen 
$ clear
cat 
displays the content of files on screen. 
$ cat file.txt
less 
Iess is similar to cat but it displays content one 
page at a time 
$ less file.txt
head 
head is a short version of less command. It 
prints only first 10 lines. 
You can set the number of lines by giving a - 
<number> flag e.x 
$ head -5 file.txt
tail 
tail is opposite to head, it shows last 10 lines of 
the file.
searching within text 
You can use less command to search within 
text. Do you remember what less command 
do? 
After executing the less command use / and 
type your required text to search 
$ less file.txt 
/science
grep (don't ask what that’s called :) ) 
This command search a file for specific word or 
a pattern. for example 
grep Science file.txt will search string Science 
in file.txt 
grep command by default is case sensitive
wc (word count) 
counts number of words in a given file. 
to find number of lines set the -l flag 
$ wc -l file.txt
Writing input to output 
type the cat command without file name. It will 
start taking your text into output memory. Once 
you press Ctrl + d the output will be printed on 
screen. 
$ cat 
$ alpha 
$ Ctrl + d
use cat to write a file 
$ cat > file.txt 
This will take your input and write to a file by 
name file.txt from your input until Ctrl+d is 
pressed.
Pipes 
Piping means passing result of one command 
to another command. 
You can search in first 10 lines by using head 
and grep command by piping 
$ head file.txt | grep science
The wildcard * 
The * character is a wildcard character. It 
means it will ignore the part after and before 
where its used 
$ ls list* 
will list all files starting with string list 
$ ls *list 
will list all files ending with string list
UNIX File System 
Type ls -l and see the result
UNIX File System 
In the left-hand column is a 10 symbol string consisting of the symbols d, r, w, x, -, and, 
occasionally, s or S. If d is present, it will be at the left hand end of the string, and indicates a 
directory: otherwise - will be the starting symbol of the string. 
The 9 remaining symbols indicate the permissions, or access rights, and are taken as three groups of 
3. 
● The left group of 3 gives the file permissions for the user that owns the file (or directory) 
(thirdknife in the above example); 
● the middle group gives the permissions for the group of people to whom the file (or directory) 
belongs (staff in the above example); 
● the rightmost group gives the permissions for all others. 
The symbols r, w, etc., have slightly different meanings depending on whether they refer to a simple 
file or to a directory.
chmod (changing file mode) 
Only owner can change the mode. 
Symbol Meaning 
u user 
g group 
o other 
a all
chmod (changing file mode) 
Symbol Meaning 
r read 
w write (and delete) 
x execute (and access directory) 
+ add permission 
- remove permission
Example 
$ chmod a+rw file.txt 
this will give read and write access to all user, 
group and others 
-rwxrwxrwx 1 thirdknife staff 5 Nov 27 23:09 
text.txt
making file executable and runnable 
For any file to be executable you have to make 
it x using chmod, e.g 
$ chmod a+x file.txt 
this will make file.txt executable for all (user, 
group and others) 
to execute a file use ./<filename>
sudo (execute commands as others) 
Use this command to do as a different user. 
$sudo su ls 
will list files as root user 
$sudo su - shakeel ls 
will list files as shakeel user
Tips 
Always use manual pages for help.I understand 
they are boring but believe me thats where I 
learned the most. Second friend is google :) 
Try to understand the error statement.
Contact 
shakeel@creanyx.com

More Related Content

What's hot

Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examplesabclearnn
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic CommandsHanan Nmr
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemSadia Bashir
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scriptingvceder
 
Quick Guide with Linux Command Line
Quick Guide with Linux Command LineQuick Guide with Linux Command Line
Quick Guide with Linux Command LineAnuchit Chalothorn
 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file systemTaaanu01
 
Process management in linux
Process management in linuxProcess management in linux
Process management in linuxMazenetsolution
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Wave Digitech
 
Linux history & features
Linux history & featuresLinux history & features
Linux history & featuresRohit Kumar
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structureSreenatha Reddy K R
 
Bash shell scripting
Bash shell scriptingBash shell scripting
Bash shell scriptingVIKAS TIWARI
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux Harish R
 
Some basic unix commands
Some basic unix commandsSome basic unix commands
Some basic unix commandsaaj_sarkar06
 
Linux command ppt
Linux command pptLinux command ppt
Linux command pptkalyanineve
 
Complete Guide for Linux shell programming
Complete Guide for Linux shell programmingComplete Guide for Linux shell programming
Complete Guide for Linux shell programmingsudhir singh yadav
 

What's hot (20)

Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examples
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
 
Basics of-linux
Basics of-linuxBasics of-linux
Basics of-linux
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
 
Linux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell ScriptingLinux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell Scripting
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scripting
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 
Quick Guide with Linux Command Line
Quick Guide with Linux Command LineQuick Guide with Linux Command Line
Quick Guide with Linux Command Line
 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file system
 
Process management in linux
Process management in linuxProcess management in linux
Process management in linux
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
 
Linux history & features
Linux history & featuresLinux history & features
Linux history & features
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
 
Bash shell scripting
Bash shell scriptingBash shell scripting
Bash shell scripting
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux
 
Linux cheat-sheet
Linux cheat-sheetLinux cheat-sheet
Linux cheat-sheet
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Some basic unix commands
Some basic unix commandsSome basic unix commands
Some basic unix commands
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
 
Complete Guide for Linux shell programming
Complete Guide for Linux shell programmingComplete Guide for Linux shell programming
Complete Guide for Linux shell programming
 

Viewers also liked

Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt onu9
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)anandvaidya
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linuxanandvaidya
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Scriptsbmguys
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338Cam YP Co., Ltd
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338Cam YP Co., Ltd
 
Basic commands (linux)
Basic commands (linux)Basic commands (linux)
Basic commands (linux)Faysal Khan
 
Ijarcet vol-2-issue-3-1280-1284
Ijarcet vol-2-issue-3-1280-1284Ijarcet vol-2-issue-3-1280-1284
Ijarcet vol-2-issue-3-1280-1284Editor IJARCET
 
Ip address classes
Ip address classesIp address classes
Ip address classesurshari
 
15 practical grep command examples in linux
15 practical grep command examples in linux15 practical grep command examples in linux
15 practical grep command examples in linuxTeja Bheemanapally
 

Viewers also liked (20)

Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt
 
Cli2 Bibalex
Cli2 BibalexCli2 Bibalex
Cli2 Bibalex
 
Linux basic commands tutorial
Linux basic commands tutorialLinux basic commands tutorial
Linux basic commands tutorial
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338
 
Basic commands (linux)
Basic commands (linux)Basic commands (linux)
Basic commands (linux)
 
Ijarcet vol-2-issue-3-1280-1284
Ijarcet vol-2-issue-3-1280-1284Ijarcet vol-2-issue-3-1280-1284
Ijarcet vol-2-issue-3-1280-1284
 
Basic Linux day 2
Basic Linux day 2Basic Linux day 2
Basic Linux day 2
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Ip address classes
Ip address classesIp address classes
Ip address classes
 
Classes of adressing
Classes of adressingClasses of adressing
Classes of adressing
 
15 practical grep command examples in linux
15 practical grep command examples in linux15 practical grep command examples in linux
15 practical grep command examples in linux
 
Classes of ip addresses
Classes of ip addressesClasses of ip addresses
Classes of ip addresses
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 

Similar to Basic linux commands

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 bioinformaticsBITS
 
File Commands - R.D.Sivakumar
File Commands - R.D.SivakumarFile Commands - R.D.Sivakumar
File Commands - R.D.SivakumarSivakumar R D .
 
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.pptLuigysToro
 
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 commandbhatvijetha
 
Workshop on command line tools - day 1
Workshop on command line tools - day 1Workshop on command line tools - day 1
Workshop on command line tools - day 1Leandro Lima
 
Unix command line concepts
Unix command line conceptsUnix command line concepts
Unix command line conceptsArtem Nagornyi
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editorshanmuga rajan
 
Commands and shell programming (3)
Commands and shell programming (3)Commands and shell programming (3)
Commands and shell programming (3)christ university
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdfGiovaRossi
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdfGiovaRossi
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdfGiovaRossi
 
Linux commands
Linux commandsLinux commands
Linux commandsU.P Police
 

Similar to Basic linux commands (20)

Linux
LinuxLinux
Linux
 
40 basic linux command
40 basic linux command40 basic linux command
40 basic linux command
 
40 basic linux command
40 basic linux command40 basic linux command
40 basic linux command
 
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
 
File Commands - R.D.Sivakumar
File Commands - R.D.SivakumarFile Commands - R.D.Sivakumar
File Commands - R.D.Sivakumar
 
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.ppt
 
Unix3
Unix3Unix3
Unix3
 
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 commands
Linux commandsLinux commands
Linux commands
 
Workshop on command line tools - day 1
Workshop on command line tools - day 1Workshop on command line tools - day 1
Workshop on command line tools - day 1
 
Unix command line concepts
Unix command line conceptsUnix command line concepts
Unix command line concepts
 
Directories description
Directories descriptionDirectories description
Directories description
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editor
 
basic-unix.pdf
basic-unix.pdfbasic-unix.pdf
basic-unix.pdf
 
Commands and shell programming (3)
Commands and shell programming (3)Commands and shell programming (3)
Commands and shell programming (3)
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdf
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdf
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdf
 
Linux commands
Linux commandsLinux commands
Linux commands
 
part2.pdf
part2.pdfpart2.pdf
part2.pdf
 

Recently uploaded

Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfIdiosysTechnologies1
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 

Recently uploaded (20)

Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdf
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 

Basic linux commands

  • 1. BASIC LINUX COMMANDS Welcome to the Linux World
  • 2. What are linux commands Linux commands are just simple programs like a program in windows. Typing command is like clicking an icon in windows. Sometimes commands take some extra parameters to do extra work, we call them flags.
  • 3. man (Your best friend!) man means manual pages, its like reading a manual of any home appliance. In software it means reading documentation. Good softwares have always a good documentation part. $ man <command> $ man clear
  • 4. ls (list items) ● The ls command ( lowercase L and lowercase S ) lists the contents of your current working directory. ● ls by default does not show hidden files ● to see all files use ls -al ● -al is flag in this case
  • 5. mkdir (make directory) ● creates a directory ● use -p to create as many directories. ● $ mkdir first/second/third -p ● $ cd first/second/third
  • 6. cd (change directory) ● changes the current directory ● cd . to remain inside same directory ● cd .. to go back one directory
  • 7. pwd (print working directory) For example, to find out the absolute pathname of your home-directory, type cd to get back to your home-directory and then type $ pwd it will print current directory
  • 8. ~ Your Home Directory By typing cd ~ in terminal it will take you to the home directory of current user $ cd ~
  • 9. cp (copy) copies a file or entire directory to another path If you want to copy files from another directory to current directory use a . for destination $ cp <source_file> <destination_file> Tip: Always read the error carefully and please don't freak out :)
  • 10. mv (move file) move command renames or move a file use -r flag to recursively move all files $ mv file1.txt file2.txt
  • 11. rm (remove) rm removes a file or entire directory with -r flag $ rm <file> $ rm <directory> -r
  • 12. clear clears your screen $ clear
  • 13. cat displays the content of files on screen. $ cat file.txt
  • 14. less Iess is similar to cat but it displays content one page at a time $ less file.txt
  • 15. head head is a short version of less command. It prints only first 10 lines. You can set the number of lines by giving a - <number> flag e.x $ head -5 file.txt
  • 16. tail tail is opposite to head, it shows last 10 lines of the file.
  • 17. searching within text You can use less command to search within text. Do you remember what less command do? After executing the less command use / and type your required text to search $ less file.txt /science
  • 18. grep (don't ask what that’s called :) ) This command search a file for specific word or a pattern. for example grep Science file.txt will search string Science in file.txt grep command by default is case sensitive
  • 19. wc (word count) counts number of words in a given file. to find number of lines set the -l flag $ wc -l file.txt
  • 20. Writing input to output type the cat command without file name. It will start taking your text into output memory. Once you press Ctrl + d the output will be printed on screen. $ cat $ alpha $ Ctrl + d
  • 21. use cat to write a file $ cat > file.txt This will take your input and write to a file by name file.txt from your input until Ctrl+d is pressed.
  • 22. Pipes Piping means passing result of one command to another command. You can search in first 10 lines by using head and grep command by piping $ head file.txt | grep science
  • 23. The wildcard * The * character is a wildcard character. It means it will ignore the part after and before where its used $ ls list* will list all files starting with string list $ ls *list will list all files ending with string list
  • 24. UNIX File System Type ls -l and see the result
  • 25. UNIX File System In the left-hand column is a 10 symbol string consisting of the symbols d, r, w, x, -, and, occasionally, s or S. If d is present, it will be at the left hand end of the string, and indicates a directory: otherwise - will be the starting symbol of the string. The 9 remaining symbols indicate the permissions, or access rights, and are taken as three groups of 3. ● The left group of 3 gives the file permissions for the user that owns the file (or directory) (thirdknife in the above example); ● the middle group gives the permissions for the group of people to whom the file (or directory) belongs (staff in the above example); ● the rightmost group gives the permissions for all others. The symbols r, w, etc., have slightly different meanings depending on whether they refer to a simple file or to a directory.
  • 26. chmod (changing file mode) Only owner can change the mode. Symbol Meaning u user g group o other a all
  • 27. chmod (changing file mode) Symbol Meaning r read w write (and delete) x execute (and access directory) + add permission - remove permission
  • 28. Example $ chmod a+rw file.txt this will give read and write access to all user, group and others -rwxrwxrwx 1 thirdknife staff 5 Nov 27 23:09 text.txt
  • 29. making file executable and runnable For any file to be executable you have to make it x using chmod, e.g $ chmod a+x file.txt this will make file.txt executable for all (user, group and others) to execute a file use ./<filename>
  • 30. sudo (execute commands as others) Use this command to do as a different user. $sudo su ls will list files as root user $sudo su - shakeel ls will list files as shakeel user
  • 31. Tips Always use manual pages for help.I understand they are boring but believe me thats where I learned the most. Second friend is google :) Try to understand the error statement.