Linux Commands Summary
Course Objective
 To introduce the Unix Operating System Concept.
 To introduce standard Unix commands.
 To introduce VI editor.
References
 Text Book Reference
 Brain W. Kernighan and Rob Pike, The UNIX Programming
Environment.
 A Practical Guide to Linux® Commands, Editors, and Shell
Programming - Mark Sobell's
 Web Reference
 Unix Tutorial For Beginners
 Introduction to Unix
 http://www.cis.uab.edu/cs344/spring2005/
What is Unix Operating System
 Unix OS is a Program
 Unix OS provides interface
between users and bare
hardware
 Unix OS manages
resources: CPU(s),
memory, disks, other I/O
devices.
Operating System
users
Why do we need Operating System ?
To Interact with Computer Hardware
End User
Computer Hardware
Operating-System
Utilities
Application
Programs
OS Designer
System Programmer
Application Programmer
E.g.
compiler, librari
es, shell
E.g.
database, web
servers
Evolution of Unix OS
Flavors of Unix
 AIX (Advanced IBM Unix)
 HP-UX ( Hewlett Packard Unix)
 BSD ( Berkeley Software Distribution. )
 SCO UNIX
 SOLARIS
 LINUX, etc
System Architecture
HARDWARE
KERNELDATABASE
UNIX
COMMANDS
COMPILERS
OTHER
APPLICATIONS
PACKAGES
SHELL
SHELL
SHELL
SHELL
User
UserUser
User
System Architecture
 Major components of Unix are :
 Kernel
 Monitors and controls hardware resources
 Allocates them among its users in an optimal manner
 Utilities
 Programming tools that do standard tasks extremely well.
 EX: cp, grep, awk, sed, bc, wc, more
 Shell
 Command Line Interpreter.
 Provides a processing environment for the user programs.
 User Applications
 Programs written by the user
Processing Environment
• User Program
– Set of instructions written by the user
• Process
– Instance of a program under execution
• Shell
– Provides a processing environment for the user programs
Structure of Unix File System
Absolute Path and Relative Path
 The Absolute Path
 The entire pathname starting from root(/)
 Example
 /home/oresoft/.
 The Relative Path
 The path relative to your present working directory
 Example
 cd ..
How Unix Session Works.
USER TYPES COMMAND
SHELL EXECUTES
UTILITY TO CARRY
OUT COMMAND
SHELLASKS FOR A COMMAND
USER INTERACTS WITH
UTILITY
SHELL PROMPTS FOR
NEXT COMMAND
USER TYPES CONTROL-D
LOGOUT
LOGIN
Login Sequence.
 /etc/passwd 1
 /etc/shadow 2
 /etc/group 3
 /etc/profile 4
 /etc/profile.d/*.sh 5
 ~/.bash_profile 6
 ~/.bashrc 7
 /etc/bashrc 8
Unix Command Structure
 Unix Command line structure
 command [options] [arguments]
Refer the following word Doc for Detail Command
Concept of stdin, stdout and stderr
Operating System
Another
Computer
program running
stdout
stderr
stdin
Keyboard
A Computer
program running
stdout
stderr
stdin
Monitor
Standard Files
 Standard Input (0)
 This file is opened by shell to accept information.
 Standard Output (1)
 This file is opened by shell to direct output
 Standard Error (2)
 This file is opened by shell for writing error messages
Regular Expressions
What is it?
 String of ordinary and metacharacter which can be used to
match more than one type of pattern.
 Uses character set
 * , [], ^, $, {}, etc.
The Shell Metacharacters.
 See Demo at
/home/oresoft/Training/Linux/commands/shellChar
 * - Matches all filenames in current directory.
 ? - Matches a single character.
 [abc] - Matches a single character – either a, b or c.
 [!abc] - Matches a single character – which is not a, b or c.
 [a-c] – Matches a single character which is within the range of a and c.
 ^abc – Matches the pattern abc at the beginning of the line.
 abc$ - Matches the pattern abc at the end of the line.
Editor in Unix
 Need for editor in Unix
 Types of editor
 Line Editor
 ed : UC Berkeley
 ex : Powerful than ed, Bell Systems
 Full Screen Editor
 vi (stands for visual)
 vim – vi improved
 emacs (GNU)
The vi Editor.
 The important characteristic features are:
 Omnipresent
 Works on different Unix flavors
 Fast
 Various operations are very fast
 Powerful UNDO features
 Text in lines could be undone with very less effort
The vi Editor.
 The limitations are:
 Less user-friendly
 No graphical user interface
 Highly Case-sensitive
 Letter in small case has a different implementation in comparison
with the same letter in upper case
 Keystrokes could have more than one meaning
 A letter (of the same case) has different implementation across
different modes.
The vi Editor.
 Modes of working:
 Command Mode
 Keys are interpreted as commands
 Insert Mode
 Keys are interpreted as data
 Escape Mode
 Keys are interpreted for saving/exiting purposes
vi Operating modes.
Command mode
Insert mode
i, I , o, O, a, A ..
esc
Last line mode
Enter:
:q
Vi editor commands
 To move around
 h, j, k, l, ^D, ^U, G, 0, ^, $, w, b
 Inserting/Deleting text
 i, a, I, A, r, R, o, O, dd, dw, c$, D, x, X.
 Changing/Replacing text.
 cc, cw, c$, ~, J, u, . , yy, yw, p, P
 File manipulation.
 :w, :wq, ZZ, :w!, :q, :q! , :![command]
Searching a pattern
 /pattern
 Searches forward for first occurrence of a pattern.
 ?pattern
 Searches backward for first occurrence of a pattern.
 n
 Repeats the last search.
 N
 Repeats the last search command in opposite direction.
Pattern Substitution.
 :s/ptn1/ptn2
 Replaces first occurrence of ptn1 with ptn2.
 : s/ptn1/ptn2/g
 Replaces all occurrences in the current line.
 : m, n s/ptn1/ptn2/g
 Replaces all occurrences in lines m to n.
 : ., $ s/ptn1/ptn2/g
 Replaces all occurrences from current line to end of file.
Customizing vi.
 The set command
 :set all
 :set nu
 The abbr command
 :abbr itl ―Infosys Technologies Ltd‖
 The map command
 :map ^X :wq
System Variables.
 PATH
 Search path referred by Unix for any command.
 echo $PATH
 HOME
 Indicates the home directory for the user.
 echo $HOME
 set command
 Used for display all the environment variables.
 Shows the current values of system variables.
 Also allows conversion of arguments into positional parameters.
 Syntax : set
set command.
File Permission - Absolute Mode.
r w x r w x r w x
4 2 1 4 2 1 4 2 1
Owner Group Other
Group OthersOwner
rwxrwxrwx
Permission Value
R 4
W 2
x 1
- No Permission
Summary
 Background
 Features of Unix
 Unix System Architecture
 Unix File System
 General Unix commands and utilities
 Processes
 Regular Expressions
 Vi Editor
 Modes of operation
File Permission – Symbolic Mode.
Who User Class Meaning
U User Owner of file
G Group Group to which owner
belongs
O Other All other Users
Who Meaning
r Sets read permission
w Sets write permission
x Sets exec permission
Symbolic mode user class specification
Symbolic mode permissions
Examples of chmod
 Syntax.
chmod [0-7][0-7][0-7] filename (Absolute
Mode)
chmod [ugo][+-][rwx] filename (Symbolic
Mode)
$ chmod a=rw temp
$ ls -l temp-rw-rw-rw- 1 alex pubs 57 Jul 12 16:47 temp
Unmasking File Permission
 umask
 Stands for user creation mask.
 Sets default permissions for a newly created file and directory.
 The value can be changed.
Example
6 6 6 - System wide default permissions
- 0 2 2 - Denial ‗mask‘ set by UMASK
6 4 4 - Resultant permissions that will be
set on all files created (-rw-r—r--)
Linux Command Suumary

More Related Content

PPTX
Unix Linux Commands Presentation 2013
PPT
ODP
Linux commands
PPT
Linux Commands
ODP
Linux Introduction (Commands)
PPT
Linux Administration
PPTX
Linux basics part 1
PDF
Linux Command Line Basics
Unix Linux Commands Presentation 2013
Linux commands
Linux Commands
Linux Introduction (Commands)
Linux Administration
Linux basics part 1
Linux Command Line Basics

What's hot (20)

PPT
Unix/Linux Basic Commands and Shell Script
DOC
Some basic unix commands
PPT
Linux presentation
PPTX
Unix OS & Commands
DOCX
Linux basic commands tutorial
PDF
50 most frequently used unix linux commands (with examples)
PPT
Unix(introduction)
PPT
A Quick Introduction to Linux
PPTX
Linux commands
PDF
Quick Guide with Linux Command Line
PPT
Basic 50 linus command
PDF
An Introduction To Linux
PPTX
Red hat linux essentials
PDF
Useful Linux and Unix commands handbook
PPS
QSpiders - Unix Operating Systems and Commands
PPTX
Linux powerpoint
PDF
Linux practicals T.Y.B.ScIT
PPT
Basic Unix
PPTX
Terminal Commands (Linux - ubuntu) (part-1)
PPTX
Know the UNIX Commands
Unix/Linux Basic Commands and Shell Script
Some basic unix commands
Linux presentation
Unix OS & Commands
Linux basic commands tutorial
50 most frequently used unix linux commands (with examples)
Unix(introduction)
A Quick Introduction to Linux
Linux commands
Quick Guide with Linux Command Line
Basic 50 linus command
An Introduction To Linux
Red hat linux essentials
Useful Linux and Unix commands handbook
QSpiders - Unix Operating Systems and Commands
Linux powerpoint
Linux practicals T.Y.B.ScIT
Basic Unix
Terminal Commands (Linux - ubuntu) (part-1)
Know the UNIX Commands
Ad

Viewers also liked (17)

PDF
Basic unix commands
PPTX
Java For beginners and CSIT and IT students
PPT
Java Notes
PDF
Unix command line concepts
PDF
Unix commands in etl testing
PPT
Basic command ppt
PPT
Basic Linux Internals
PPT
Unix command-line tools
PPT
Linux command ppt
PDF
Core java complete notes - Contact at +91-814-614-5674
PDF
Java SE 8 best practices
PPTX
UNIX/Linux training
PDF
Top 100 Linux Interview Questions and Answers 2014
PPTX
Linux.ppt
PDF
The Buyer's Journey - by Chris Lema
Basic unix commands
Java For beginners and CSIT and IT students
Java Notes
Unix command line concepts
Unix commands in etl testing
Basic command ppt
Basic Linux Internals
Unix command-line tools
Linux command ppt
Core java complete notes - Contact at +91-814-614-5674
Java SE 8 best practices
UNIX/Linux training
Top 100 Linux Interview Questions and Answers 2014
Linux.ppt
The Buyer's Journey - by Chris Lema
Ad

Similar to Linux Command Suumary (20)

PPTX
Commands and shell programming (3)
PPTX
Unix_Introduction_BCA.pptx the very basi
PPTX
Unix Shell Script - 2 Days Session.pptx
PPTX
Operating System Laboratory presentation .ppt
DOCX
Unix lab manual
PPT
Karkha unix shell scritping
PPT
Unix fundamentals and_shell scripting
PPTX
Chapter 2 Introduction to Unix Concepts
DOC
58518522 study-aix
PPTX
Linux Basic commands and VI Editor
PDF
Unix and Linux - The simple introduction
ODP
PPTX
Unix final
PPTX
Unix Operating System
PPSX
Unix environment [autosaved]
ODP
Nithi
PPTX
PPT
Unix tutorial-08
PPTX
Introduction To Unix.pptx
Commands and shell programming (3)
Unix_Introduction_BCA.pptx the very basi
Unix Shell Script - 2 Days Session.pptx
Operating System Laboratory presentation .ppt
Unix lab manual
Karkha unix shell scritping
Unix fundamentals and_shell scripting
Chapter 2 Introduction to Unix Concepts
58518522 study-aix
Linux Basic commands and VI Editor
Unix and Linux - The simple introduction
Unix final
Unix Operating System
Unix environment [autosaved]
Nithi
Unix tutorial-08
Introduction To Unix.pptx

Recently uploaded (20)

PDF
Unleashing the Potential of the Cultural and creative industries
DOCX
THEORY AND PRACTICE ASSIGNMENT SEMESTER MAY 2025.docx
PPTX
ACFE CERTIFICATION TRAINING ON LAW.pptx
PDF
Diabetes Mellitus , types , clinical picture, investigation and managment
PDF
Horaris_Grups_25-26_Definitiu_15_07_25.pdf
PDF
IS1343_2012...........................pdf
PDF
LATAM’s Top EdTech Innovators Transforming Learning in 2025.pdf
PPTX
IT infrastructure and emerging technologies
PDF
BSc-Zoology-02Sem-DrVijay-Comparative anatomy of vertebrates.pdf
PDF
Chevening Scholarship Application and Interview Preparation Guide
PDF
FAMILY PLANNING (preventative and social medicine pdf)
PPTX
Theoretical for class.pptxgshdhddhdhdhgd
PDF
HSE 2022-2023.pdf الصحه والسلامه هندسه نفط
DOCX
EDUCATIONAL ASSESSMENT ASSIGNMENT SEMESTER MAY 2025.docx
PPTX
Neurological complocations of systemic disease
PPTX
Math 2 Quarter 2 Week 1 Matatag Curriculum
PDF
CHALLENGES FACED BY TEACHERS WHEN TEACHING LEARNERS WITH DEVELOPMENTAL DISABI...
PPTX
Diploma pharmaceutics notes..helps diploma students
PPTX
MMW-CHAPTER-1-final.pptx major Elementary Education
PPTX
Copy of ARAL Program Primer_071725(1).pptx
Unleashing the Potential of the Cultural and creative industries
THEORY AND PRACTICE ASSIGNMENT SEMESTER MAY 2025.docx
ACFE CERTIFICATION TRAINING ON LAW.pptx
Diabetes Mellitus , types , clinical picture, investigation and managment
Horaris_Grups_25-26_Definitiu_15_07_25.pdf
IS1343_2012...........................pdf
LATAM’s Top EdTech Innovators Transforming Learning in 2025.pdf
IT infrastructure and emerging technologies
BSc-Zoology-02Sem-DrVijay-Comparative anatomy of vertebrates.pdf
Chevening Scholarship Application and Interview Preparation Guide
FAMILY PLANNING (preventative and social medicine pdf)
Theoretical for class.pptxgshdhddhdhdhgd
HSE 2022-2023.pdf الصحه والسلامه هندسه نفط
EDUCATIONAL ASSESSMENT ASSIGNMENT SEMESTER MAY 2025.docx
Neurological complocations of systemic disease
Math 2 Quarter 2 Week 1 Matatag Curriculum
CHALLENGES FACED BY TEACHERS WHEN TEACHING LEARNERS WITH DEVELOPMENTAL DISABI...
Diploma pharmaceutics notes..helps diploma students
MMW-CHAPTER-1-final.pptx major Elementary Education
Copy of ARAL Program Primer_071725(1).pptx

Linux Command Suumary

  • 2. Course Objective  To introduce the Unix Operating System Concept.  To introduce standard Unix commands.  To introduce VI editor.
  • 3. References  Text Book Reference  Brain W. Kernighan and Rob Pike, The UNIX Programming Environment.  A Practical Guide to Linux® Commands, Editors, and Shell Programming - Mark Sobell's  Web Reference  Unix Tutorial For Beginners  Introduction to Unix  http://www.cis.uab.edu/cs344/spring2005/
  • 4. What is Unix Operating System  Unix OS is a Program  Unix OS provides interface between users and bare hardware  Unix OS manages resources: CPU(s), memory, disks, other I/O devices. Operating System users
  • 5. Why do we need Operating System ? To Interact with Computer Hardware End User Computer Hardware Operating-System Utilities Application Programs OS Designer System Programmer Application Programmer E.g. compiler, librari es, shell E.g. database, web servers
  • 7. Flavors of Unix  AIX (Advanced IBM Unix)  HP-UX ( Hewlett Packard Unix)  BSD ( Berkeley Software Distribution. )  SCO UNIX  SOLARIS  LINUX, etc
  • 9. System Architecture  Major components of Unix are :  Kernel  Monitors and controls hardware resources  Allocates them among its users in an optimal manner  Utilities  Programming tools that do standard tasks extremely well.  EX: cp, grep, awk, sed, bc, wc, more  Shell  Command Line Interpreter.  Provides a processing environment for the user programs.  User Applications  Programs written by the user
  • 10. Processing Environment • User Program – Set of instructions written by the user • Process – Instance of a program under execution • Shell – Provides a processing environment for the user programs
  • 11. Structure of Unix File System
  • 12. Absolute Path and Relative Path  The Absolute Path  The entire pathname starting from root(/)  Example  /home/oresoft/.  The Relative Path  The path relative to your present working directory  Example  cd ..
  • 13. How Unix Session Works. USER TYPES COMMAND SHELL EXECUTES UTILITY TO CARRY OUT COMMAND SHELLASKS FOR A COMMAND USER INTERACTS WITH UTILITY SHELL PROMPTS FOR NEXT COMMAND USER TYPES CONTROL-D LOGOUT LOGIN
  • 14. Login Sequence.  /etc/passwd 1  /etc/shadow 2  /etc/group 3  /etc/profile 4  /etc/profile.d/*.sh 5  ~/.bash_profile 6  ~/.bashrc 7  /etc/bashrc 8
  • 15. Unix Command Structure  Unix Command line structure  command [options] [arguments] Refer the following word Doc for Detail Command
  • 16. Concept of stdin, stdout and stderr Operating System Another Computer program running stdout stderr stdin Keyboard A Computer program running stdout stderr stdin Monitor
  • 17. Standard Files  Standard Input (0)  This file is opened by shell to accept information.  Standard Output (1)  This file is opened by shell to direct output  Standard Error (2)  This file is opened by shell for writing error messages
  • 18. Regular Expressions What is it?  String of ordinary and metacharacter which can be used to match more than one type of pattern.  Uses character set  * , [], ^, $, {}, etc.
  • 19. The Shell Metacharacters.  See Demo at /home/oresoft/Training/Linux/commands/shellChar  * - Matches all filenames in current directory.  ? - Matches a single character.  [abc] - Matches a single character – either a, b or c.  [!abc] - Matches a single character – which is not a, b or c.  [a-c] – Matches a single character which is within the range of a and c.  ^abc – Matches the pattern abc at the beginning of the line.  abc$ - Matches the pattern abc at the end of the line.
  • 20. Editor in Unix  Need for editor in Unix  Types of editor  Line Editor  ed : UC Berkeley  ex : Powerful than ed, Bell Systems  Full Screen Editor  vi (stands for visual)  vim – vi improved  emacs (GNU)
  • 21. The vi Editor.  The important characteristic features are:  Omnipresent  Works on different Unix flavors  Fast  Various operations are very fast  Powerful UNDO features  Text in lines could be undone with very less effort
  • 22. The vi Editor.  The limitations are:  Less user-friendly  No graphical user interface  Highly Case-sensitive  Letter in small case has a different implementation in comparison with the same letter in upper case  Keystrokes could have more than one meaning  A letter (of the same case) has different implementation across different modes.
  • 23. The vi Editor.  Modes of working:  Command Mode  Keys are interpreted as commands  Insert Mode  Keys are interpreted as data  Escape Mode  Keys are interpreted for saving/exiting purposes
  • 24. vi Operating modes. Command mode Insert mode i, I , o, O, a, A .. esc Last line mode Enter: :q
  • 25. Vi editor commands  To move around  h, j, k, l, ^D, ^U, G, 0, ^, $, w, b  Inserting/Deleting text  i, a, I, A, r, R, o, O, dd, dw, c$, D, x, X.  Changing/Replacing text.  cc, cw, c$, ~, J, u, . , yy, yw, p, P  File manipulation.  :w, :wq, ZZ, :w!, :q, :q! , :![command]
  • 26. Searching a pattern  /pattern  Searches forward for first occurrence of a pattern.  ?pattern  Searches backward for first occurrence of a pattern.  n  Repeats the last search.  N  Repeats the last search command in opposite direction.
  • 27. Pattern Substitution.  :s/ptn1/ptn2  Replaces first occurrence of ptn1 with ptn2.  : s/ptn1/ptn2/g  Replaces all occurrences in the current line.  : m, n s/ptn1/ptn2/g  Replaces all occurrences in lines m to n.  : ., $ s/ptn1/ptn2/g  Replaces all occurrences from current line to end of file.
  • 28. Customizing vi.  The set command  :set all  :set nu  The abbr command  :abbr itl ―Infosys Technologies Ltd‖  The map command  :map ^X :wq
  • 29. System Variables.  PATH  Search path referred by Unix for any command.  echo $PATH  HOME  Indicates the home directory for the user.  echo $HOME
  • 30.  set command  Used for display all the environment variables.  Shows the current values of system variables.  Also allows conversion of arguments into positional parameters.  Syntax : set set command.
  • 31. File Permission - Absolute Mode. r w x r w x r w x 4 2 1 4 2 1 4 2 1 Owner Group Other Group OthersOwner rwxrwxrwx Permission Value R 4 W 2 x 1 - No Permission
  • 32. Summary  Background  Features of Unix  Unix System Architecture  Unix File System  General Unix commands and utilities  Processes  Regular Expressions  Vi Editor  Modes of operation
  • 33. File Permission – Symbolic Mode. Who User Class Meaning U User Owner of file G Group Group to which owner belongs O Other All other Users Who Meaning r Sets read permission w Sets write permission x Sets exec permission Symbolic mode user class specification Symbolic mode permissions
  • 34. Examples of chmod  Syntax. chmod [0-7][0-7][0-7] filename (Absolute Mode) chmod [ugo][+-][rwx] filename (Symbolic Mode) $ chmod a=rw temp $ ls -l temp-rw-rw-rw- 1 alex pubs 57 Jul 12 16:47 temp
  • 35. Unmasking File Permission  umask  Stands for user creation mask.  Sets default permissions for a newly created file and directory.  The value can be changed. Example 6 6 6 - System wide default permissions - 0 2 2 - Denial ‗mask‘ set by UMASK 6 4 4 - Resultant permissions that will be set on all files created (-rw-r—r--)