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

More Related Content

What's hot

Unix Shell Script
Unix Shell ScriptUnix Shell Script
Unix Shell Script
student
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
Mustafa Qasim
 

What's hot (20)

Useful Linux and Unix commands handbook
Useful Linux and Unix commands handbookUseful Linux and Unix commands handbook
Useful Linux and Unix commands handbook
 
Linux powerpoint
Linux powerpointLinux powerpoint
Linux powerpoint
 
Linux Shell Basics
Linux Shell BasicsLinux Shell Basics
Linux Shell Basics
 
BASIC COMMANDS OF LINUX
BASIC COMMANDS OF LINUXBASIC COMMANDS OF LINUX
BASIC COMMANDS OF LINUX
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Complete Guide for Linux shell programming
Complete Guide for Linux shell programmingComplete Guide for Linux shell programming
Complete Guide for Linux shell programming
 
Terminal Commands (Linux - ubuntu) (part-1)
Terminal Commands  (Linux - ubuntu) (part-1)Terminal Commands  (Linux - ubuntu) (part-1)
Terminal Commands (Linux - ubuntu) (part-1)
 
Unix slideshare
Unix slideshareUnix slideshare
Unix slideshare
 
Basics of-linux
Basics of-linuxBasics of-linux
Basics of-linux
 
Basic commands
Basic commandsBasic commands
Basic commands
 
Quick Guide with Linux Command Line
Quick Guide with Linux Command LineQuick Guide with Linux Command Line
Quick Guide with Linux Command Line
 
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)
 
system management -shell programming by gaurav raikar
system management -shell programming by gaurav raikarsystem management -shell programming by gaurav raikar
system management -shell programming by gaurav raikar
 
Unix Shell Script
Unix Shell ScriptUnix Shell Script
Unix Shell Script
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
 
Linux basics
Linux basicsLinux basics
Linux basics
 
Linux command for beginners
Linux command for beginnersLinux command for beginners
Linux command for beginners
 
Linux commands
Linux commandsLinux commands
Linux commands
 
17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards
 

Viewers also liked

Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014
iimjobs and hirist
 

Viewers also liked (16)

Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
 
Intr fortran90
Intr fortran90Intr fortran90
Intr fortran90
 
Open source applications softwares
Open source applications softwaresOpen source applications softwares
Open source applications softwares
 
Module 1 introduction to Linux
Module 1 introduction to LinuxModule 1 introduction to Linux
Module 1 introduction to Linux
 
Linux fundamental - Chap 07 vi
Linux fundamental - Chap 07 viLinux fundamental - Chap 07 vi
Linux fundamental - Chap 07 vi
 
Importance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation readingImportance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation reading
 
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios CoreNagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
 
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and NagiosNagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
 
Presentation on generation of languages
Presentation on generation of languagesPresentation on generation of languages
Presentation on generation of languages
 
Apache Pig: A big data processor
Apache Pig: A big data processorApache Pig: A big data processor
Apache Pig: A big data processor
 
Why favour Icinga over Nagios - Rootconf 2015
Why favour Icinga over Nagios - Rootconf 2015Why favour Icinga over Nagios - Rootconf 2015
Why favour Icinga over Nagios - Rootconf 2015
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
Introduction to linux ppt
Introduction to linux pptIntroduction to linux ppt
Introduction to linux ppt
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt
 
Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014
 

Similar to Module 02 Using Linux Command Shell

8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
southees
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338
Cam YP Co., Ltd
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
Dimas Prasetyo
 

Similar to Module 02 Using Linux Command Shell (20)

linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.ppt
 
UNIX.pptx
UNIX.pptxUNIX.pptx
UNIX.pptx
 
Shell_Scripting.ppt
Shell_Scripting.pptShell_Scripting.ppt
Shell_Scripting.ppt
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
 
basic-unix.pdf
basic-unix.pdfbasic-unix.pdf
basic-unix.pdf
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
 
Unix_QT.ppsx
Unix_QT.ppsxUnix_QT.ppsx
Unix_QT.ppsx
 
Unix_QT.ppsx
Unix_QT.ppsxUnix_QT.ppsx
Unix_QT.ppsx
 
User administration concepts and mechanisms
User administration concepts and mechanismsUser administration concepts and mechanisms
User administration concepts and mechanisms
 
Programming Embedded linux
Programming Embedded linuxProgramming Embedded linux
Programming Embedded linux
 
Unix tutorial-08
Unix tutorial-08Unix tutorial-08
Unix tutorial-08
 
Suman bhatt
Suman bhattSuman bhatt
Suman bhatt
 
linux commands.pdf
linux commands.pdflinux commands.pdf
linux commands.pdf
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338
 
Introduction 2 linux
Introduction 2 linuxIntroduction 2 linux
Introduction 2 linux
 
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
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 

More from Tushar B Kute

More from Tushar B Kute (20)

01 Introduction to Android
01 Introduction to Android01 Introduction to Android
01 Introduction to Android
 
Ubuntu OS and it's Flavours
Ubuntu OS and it's FlavoursUbuntu OS and it's Flavours
Ubuntu OS and it's Flavours
 
Install Drupal in Ubuntu by Tushar B. Kute
Install Drupal in Ubuntu by Tushar B. KuteInstall Drupal in Ubuntu by Tushar B. Kute
Install Drupal in Ubuntu by Tushar B. Kute
 
Install Wordpress in Ubuntu Linux by Tushar B. Kute
Install Wordpress in Ubuntu Linux by Tushar B. KuteInstall Wordpress in Ubuntu Linux by Tushar B. Kute
Install Wordpress in Ubuntu Linux by Tushar B. Kute
 
Share File easily between computers using sftp
Share File easily between computers using sftpShare File easily between computers using sftp
Share File easily between computers using sftp
 
Signal Handling in Linux
Signal Handling in LinuxSignal Handling in Linux
Signal Handling in Linux
 
Implementation of FIFO in Linux
Implementation of FIFO in LinuxImplementation of FIFO in Linux
Implementation of FIFO in Linux
 
Implementation of Pipe in Linux
Implementation of Pipe in LinuxImplementation of Pipe in Linux
Implementation of Pipe in Linux
 
Basic Multithreading using Posix Threads
Basic Multithreading using Posix ThreadsBasic Multithreading using Posix Threads
Basic Multithreading using Posix Threads
 
Part 04 Creating a System Call in Linux
Part 04 Creating a System Call in LinuxPart 04 Creating a System Call in Linux
Part 04 Creating a System Call in Linux
 
Part 03 File System Implementation in Linux
Part 03 File System Implementation in LinuxPart 03 File System Implementation in Linux
Part 03 File System Implementation in Linux
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 
Part 01 Linux Kernel Compilation (Ubuntu)
Part 01 Linux Kernel Compilation (Ubuntu)Part 01 Linux Kernel Compilation (Ubuntu)
Part 01 Linux Kernel Compilation (Ubuntu)
 
Introduction to Ubuntu Edge Operating System (Ubuntu Touch)
Introduction to Ubuntu Edge Operating System (Ubuntu Touch)Introduction to Ubuntu Edge Operating System (Ubuntu Touch)
Introduction to Ubuntu Edge Operating System (Ubuntu Touch)
 
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 KuteUnit 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
 
Technical blog by Engineering Students of Sandip Foundation, itsitrc
Technical blog by Engineering Students of Sandip Foundation, itsitrcTechnical blog by Engineering Students of Sandip Foundation, itsitrc
Technical blog by Engineering Students of Sandip Foundation, itsitrc
 
Chapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B KuteChapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B Kute
 
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B KuteChapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
 
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B KuteJava Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
 
Module 01 Introduction to Linux
Module 01 Introduction to LinuxModule 01 Introduction to Linux
Module 01 Introduction to Linux
 

Recently uploaded

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Recently uploaded (20)

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 

Module 02 Using Linux Command Shell

  • 1. Module-2 Using Linux Command Shell Tushar B Kute tushar.kute@gmail.com http://snashlug.org contact@snashlug.org
  • 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