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
Ad

Recommended

Introduction to Shell script
Introduction to Shell script
Bhavesh Padharia
 
Bash shell scripting
Bash shell scripting
VIKAS TIWARI
 
Shell programming
Shell programming
Moayad Moawiah
 
Unix
Unix
Sudharsan S
 
Basic 50 linus command
Basic 50 linus command
MAGNA COLLEGE OF ENGINEERING
 
SHELL PROGRAMMING
SHELL PROGRAMMING
jinal thakrar
 
Basic command ppt
Basic command ppt
Rohit Kumar
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
sbmguys
 
Useful Linux and Unix commands handbook
Useful Linux and Unix commands handbook
Wave Digitech
 
Linux powerpoint
Linux powerpoint
bijanshr
 
Linux Shell Basics
Linux Shell Basics
Constantine Nosovsky
 
BASIC COMMANDS OF LINUX
BASIC COMMANDS OF LINUX
Mr.AKHILESH KUMAR {Computer Lab Technician}
 
Basic linux commands
Basic linux commands
Shakeel Shafiq
 
Complete Guide for Linux shell programming
Complete Guide for Linux shell programming
sudhir singh yadav
 
Terminal Commands (Linux - ubuntu) (part-1)
Terminal Commands (Linux - ubuntu) (part-1)
raj upadhyay
 
Unix slideshare
Unix slideshare
Mohan Krishna Kona
 
Basics of-linux
Basics of-linux
Singsys Pte Ltd
 
Basic commands
Basic commands
ambilivava
 
Quick Guide with Linux Command Line
Quick Guide with Linux Command Line
Anuchit Chalothorn
 
50 most frequently used unix linux commands (with examples)
50 most frequently used unix linux commands (with examples)
Rodrigo Maia
 
system management -shell programming by gaurav raikar
system management -shell programming by gaurav raikar
GauravRaikar3
 
Unix Shell Script
Unix Shell Script
student
 
Linux commands and file structure
Linux commands and file structure
Sreenatha Reddy K R
 
Unix Shell Scripting
Unix Shell Scripting
Mustafa Qasim
 
Linux basics
Linux basics
Geeta Vinnakota
 
Linux command for beginners
Linux command for beginners
SuKyeong Jang
 
Linux commands
Linux commands
Mannu Khani
 
17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards
Denis Ristic
 
Linux command ppt
Linux command ppt
kalyanineve
 
Intr fortran90
Intr fortran90
neetesh singh raghuvanshi
 

More Related Content

What's hot (20)

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

Viewers also liked (16)

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

Similar to Module 02 Using Linux Command Shell (20)

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

More from Tushar B Kute (20)

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

Recently uploaded (20)

Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Puppy jhon
 
AI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA Technologies
SandeepKS52
 
Open Source Software Development Methods
Open Source Software Development Methods
VICTOR MAESTRE RAMIREZ
 
Transmission Media. (Computer Networks)
Transmission Media. (Computer Networks)
S Pranav (Deepu)
 
Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)
VICTOR MAESTRE RAMIREZ
 
Migrating to Azure Cosmos DB the Right Way
Migrating to Azure Cosmos DB the Right Way
Alexander (Alex) Komyagin
 
What is data visualization and how data visualization tool can help.pdf
What is data visualization and how data visualization tool can help.pdf
Varsha Nayak
 
UPDASP a project coordination unit ......
UPDASP a project coordination unit ......
withrj1
 
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
soulamaabdoulaye128
 
OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
Porting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 Webinar
ICS
 
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
BradBedford3
 
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
BradBedford3
 
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
Maharshi Mallela
 
Step by step guide to install Flutter and Dart
Step by step guide to install Flutter and Dart
S Pranav (Deepu)
 
Making significant Software Architecture decisions
Making significant Software Architecture decisions
Bert Jan Schrijver
 
Reimagining Software Development and DevOps with Agentic AI
Reimagining Software Development and DevOps with Agentic AI
Maxim Salnikov
 
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
usmanch7829
 
dp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdf
pravkumarbiz
 
Advanced Token Development - Decentralized Innovation
Advanced Token Development - Decentralized Innovation
arohisinghas720
 
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Puppy jhon
 
AI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA Technologies
SandeepKS52
 
Open Source Software Development Methods
Open Source Software Development Methods
VICTOR MAESTRE RAMIREZ
 
Transmission Media. (Computer Networks)
Transmission Media. (Computer Networks)
S Pranav (Deepu)
 
Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)
VICTOR MAESTRE RAMIREZ
 
What is data visualization and how data visualization tool can help.pdf
What is data visualization and how data visualization tool can help.pdf
Varsha Nayak
 
UPDASP a project coordination unit ......
UPDASP a project coordination unit ......
withrj1
 
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
soulamaabdoulaye128
 
OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
Porting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 Webinar
ICS
 
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
BradBedford3
 
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
BradBedford3
 
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
Maharshi Mallela
 
Step by step guide to install Flutter and Dart
Step by step guide to install Flutter and Dart
S Pranav (Deepu)
 
Making significant Software Architecture decisions
Making significant Software Architecture decisions
Bert Jan Schrijver
 
Reimagining Software Development and DevOps with Agentic AI
Reimagining Software Development and DevOps with Agentic AI
Maxim Salnikov
 
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
usmanch7829
 
dp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdf
pravkumarbiz
 
Advanced Token Development - Decentralized Innovation
Advanced Token Development - Decentralized Innovation
arohisinghas720
 

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