SlideShare une entreprise Scribd logo
1  sur  127
Unix Fundamentals and command references



        Solaris

              Linux

                      HP-UX

                          AIX
Commands
uname - It shows system identification information
showrev - System information with Host ID
# pwd – It shows the present working directory
Unix file types
ls - List of directories and files
ls continues
ls continues …
cal - It shows calendar
date - it shows the current date




Date format :
       mm dd hh mm yy . s
mkdir – to create a new directory
cd - to change the directory
rmdir or rm –r - to remove the directory




mv – move or rename the directory or file
mv continues … ( if destination directory already exists
“ mv “ moves source directory to destination directory ).
cp - It copies directories and files from one location to
another location.




“ cp “command copies only files from one location to another
 location. “ cp - r “ Can be used to copy directories.
“ cat “ command is used to create or read the contents
of the files.




To append some more content with the existing file “ >> “
can be used.
“ file “ is a command which tells you the property of file or
Directory.
“ more “ command displays the file contents page wise.
“ less “ command displays the file content like “ more “
command but, it has to be closed with “ q “.
“ touch “ is the command which creates zero length files or
it puts time stamp on the file or files which are already exist.
“ head “ command displays the file contents with “ – “option
“ tail “ command displays file contents like “ head “
with “ - , + “ option.
“ sort “ command displays file contents in ascending and
descending order.
“ wc - word count “ command displays words, lines, chars,
bytes, mem size and all.
“ which “ command shows the location of the commands,
 which are set in environment variable “ PATH “
“ df – Disk free “ command shows the disk space level
“ clear “ command clears the screen
“ tty “ the terminal command shows the pseudo terminals.
“ echo “ command show the given value or shows the value
of the environment varriables.
“ grep “ is the command which displays the line with the
matching pattern. It can be executed with more options.

Option                                 Definition
   -i      Searches for both uppercase and lowercase characters


   -l      Lists the names of files with matching lines


   -n      Precedes each line with the relative line number in the file


   -v      Inverts the search to display lines that do not match the
           pattern
   -c      Counts the lines that contain the pattern


   -w      Searches for the expression as a complete word, ignoring
           those matches that are substrings of larger words.
The “ grep “ command supports several regular expression
Meta characters to further define a search pattern. This table
describes some of the regular expression meta characters.
Regular expression meta characters:

Metacharacter      Purpose           Example            Result


     ^            Beginning of       ’^pattern’   Matches all lines
                  line anchor                     beginning
                                                  with “pattern”


     $             End of line       ’pattern$’   Matches all lines
                    anchor                        ending
                                                  with “pattern”
Additional regular expression meta characters:
Metacharacter   Purpose         Example            Result

                Matches one     ’p.....n’          Matches lines
      .
                character                          containing a
                                                   “p,” followed by
                                                   Five characters,
                                                   and followed
                                                   by an “n”

                Matches the     ’[a-z]*’           Matches
      *
                preceding                          Lowercase
                item zero or                       Alphanumeric
                more times                         characters or
                                                   nothing at all
“ grep “ continues …

Metacharacter      Purpose          Example        Result

                   Matches one                     Matches lines
                   character in     ’[Pp]attern’   Containing
       []                                          “Pattern” or
                   the pattern
                                                   “pattern”


                   Matches one                     Matches lines that
                   character not                   do not contain “a”
       [^]                          ’[^am]
                   in the pattern                  through “m” and
                                    attern’        followed by“attern”
“ grep “ continues …
“ grep “ continues ….
“ grep “ continues ..
“ grep “ continues ..
“ grep “ continues ….
“ grep “ continues….
“ grep “ continues …
Egrep



The egrep command searches the contents of one or more files
for a pattern using extended regular expression metacharacters.
Extended regular expression metacharacters include the regular
expression metacharacters that the grep command uses, plus
some additional metacharacters.
Egrep
    Metacharacter         Purpose                 Sample             Result


+                   Matches one or        ’[a-z]+ark’        Matches one or more
                    more of the                              lowercase letters
                    preceding                                followed by “ark” (for
                    characters                               example, “airpark,”
                                                             “bark,” “dark,”
                                                             “landmark,” “shark,”
                                                             “sparkle,” “trademark”)

?                   Matches zero          ‘patte[r?]’        Matches lines
                    or one                                   Containing the literal
                    character                                character or
                                                             metacharacter it
                                                             follows

x|y                 Matches either x or   ’apple | orange’   Matches for either
                    y                                        expression
“ egrep Example :
“ egrep “ continues…
“ egrep continues …
Pgrep   The “ process grep “ command finds and displays the
        process ID along with It’s parent process ID.
FIND

“ find “ is a command to find a file or directory in the
system globally.
“ find “ continues …
“ find “ continues …
“ find “ continues …
“ find “ continues ..
“ w “ is a command which shows the particular user’s
Information in an elaborate manner.
“ SU “ command can be used to switch over from one user to
an other user physically.
“ who “ command shows a respective user’s information
“ who “ continues …
“ id “ command shows user’s ID and primary group ID
“ finger “ command displays the user information along with
user’s status
“ Link “ is a command which creates link between source and
destination file. The following example shows the symbolic link.
“ Hard Link “ creates link between source and destination.
Unix File permissions
Changing file permissions in symbolic mode
“ chmod “ continues …
“ chmod “ continues in octal mode …
“ chmod “ continues in octal mode…
“ umask “ continues …
Korn Shell
The Default korn shell variables
Customizing Korn Shell Variable




To change the shell environment from Bourn shell to
Korn shell :
To change the prompt ..




 To change the prompt variable…
“ History command …
“ alias command …”
Using VI Editor
Identifying the Fundamentals of vi Editor operation

• Introducing the vi editor modes of operation

• The command mode

• The edit mode

• The last line mode

• Switching between the command and edit modes

• Introducing the vi command
Remote Login using TELNET and RLOGIN
Using RLOGIN …
File Archives

tar
      -c   - to create tar archive
      -v   - to get verbose
      -f   - the out put device or directory
      -t   - table of contents
      -x   - extract from the tar archive
To create tar archive          Example




 To see the table of content
To extract from the tar archive
Compress
To compress the tar archive
Example for compress archive
Uncompressing tar archive
gzip

       To create gzip archive
To extract the tar archive by gunzip
Unix Administration




     Solaris
Solaris User Administration

Each user account consists of five main components:

• User name

• Password

• User’s home directory

• User’s login shell

• User initialization files
Managing User Accounts
Before you can add user accounts to the system, you must
determine the following information for each new user:

• Login name

• User identification (UID) number

• Group identification (GID) number

• Comment

• home directory

• Login shell

• Password aging
Storing User and Group Account information

The Solaris Operating Environment stores user account and group account
information in the following system files:

• /etc/passwd – Authorized system users have login account entries in the
/etc/passwd file.

• /etc/shadow – All passwords are encrypted and maintained in a separate
shadow file named

/etc/shadow.

• /etc/group – The /etc/group file defines the default system group accounts.
The “ /etc/passwd “ file format

root:x:0:1:Super-User:/:/sbin/sh
daemon:x:1:1::/:
bin:x:2:2::/usr/bin:
sys:x:3:3::/:
adm:x:4:4:Admin:/var/adm:
lp:x:71:8:Line Printer Admin:/usr/spool/lp:
smtp:x:0:0:Mail Daemon User:/:
uucp:x:5:5:uucp Admin:/usr/lib/uucp:
nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/
lib/uucp/uucico
listen:x:37:4:Network Admin:/usr/net/nls:
nobody:x:60001:60001:Nobody:/:
noaccess:x:60002:60002:No Access User:/:
nobody4:x:65534:65534:SunOS 4.x Nobody:/:
The “ /etc/shadow “ file format


root:LXeoktCoMtwZN:6445::::::
daemon:NP:6445::::::
bin:NP:6445::::::
sys:NP:6445::::::
adm:NP:6445::::::
lp:NP:6445::::::
smtp:NP:6445::::::
uucp:NP:6445::::::
nuucp:NP:6445::::::
listen:*LK*:::::::
nobody:NP:6445::::::
noaccess:NP:6445::::::
nobody4:NP:6445::::::
The “ /etc/group “ file format
root::0:root
other::1:
bin::2:root,bin,daemon
sys::3:root,bin,sys,adm
adm::4:root,adm,daemon
uucp::5:root,uucp
mail::6:root
tty::7:root,tty,adm
lp::8:root,lp,adm
nuucp::9:root,nuucp
staff::10:
daemon::12:root,daemon
sysadmin::14:lister,torey
nobody::60001:
noaccess::60002:
nogroup::65534:
Command line User Account Administration


The following command-line tools add, modify, and delete
user accounts and group accounts on the local system:

• useradd – Adds a new user account

• usermod – Modifies a user’s account

• userdel – Deletes a user’s account

• groupadd – Adds (creates) a new group account

• groupmod – Modifies a group account

• groupdel – Deletes a group account
Example :
Example :
Example :
Example :
Example :
Example :
Scheduled Process Control
Viewing current process status
Re-scheduling the process
Administering the active process
Unix commands
Unix commands

Contenu connexe

Tendances

String & its application
String & its applicationString & its application
String & its application
Tech_MX
 
Write Your Own JVM Compiler
Write Your Own JVM CompilerWrite Your Own JVM Compiler
Write Your Own JVM Compiler
Erin Dees
 
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
Teja Bheemanapally
 
Python advanced 2. regular expression in python
Python advanced 2. regular expression in pythonPython advanced 2. regular expression in python
Python advanced 2. regular expression in python
John(Qiang) Zhang
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Raghu nath
 
String variable in php
String variable in phpString variable in php
String variable in php
chantholnet
 
Perl 101 - The Basics of Perl Programming
Perl  101 - The Basics of Perl ProgrammingPerl  101 - The Basics of Perl Programming
Perl 101 - The Basics of Perl Programming
Utkarsh Sengar
 

Tendances (20)

Bioinformatics p2-p3-perl-regexes v2013-wim_vancriekinge
Bioinformatics p2-p3-perl-regexes v2013-wim_vancriekingeBioinformatics p2-p3-perl-regexes v2013-wim_vancriekinge
Bioinformatics p2-p3-perl-regexes v2013-wim_vancriekinge
 
Spsl II unit
Spsl   II unitSpsl   II unit
Spsl II unit
 
Regular Expressions in PHP
Regular Expressions in PHPRegular Expressions in PHP
Regular Expressions in PHP
 
String & its application
String & its applicationString & its application
String & its application
 
Awk programming
Awk programming Awk programming
Awk programming
 
Write Your Own JVM Compiler
Write Your Own JVM CompilerWrite Your Own JVM Compiler
Write Your Own JVM Compiler
 
3 character strings and formatted input output
3  character strings and formatted input output3  character strings and formatted input output
3 character strings and formatted input output
 
Thnad's Revenge
Thnad's RevengeThnad's Revenge
Thnad's Revenge
 
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
 
Intoduction to php strings
Intoduction to php  stringsIntoduction to php  strings
Intoduction to php strings
 
JRuby, Not Just For Hard-Headed Pragmatists Anymore
JRuby, Not Just For Hard-Headed Pragmatists AnymoreJRuby, Not Just For Hard-Headed Pragmatists Anymore
JRuby, Not Just For Hard-Headed Pragmatists Anymore
 
Grep - A powerful search utility
Grep - A powerful search utilityGrep - A powerful search utility
Grep - A powerful search utility
 
Python advanced 2. regular expression in python
Python advanced 2. regular expression in pythonPython advanced 2. regular expression in python
Python advanced 2. regular expression in python
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Your Own Metric System
Your Own Metric SystemYour Own Metric System
Your Own Metric System
 
String variable in php
String variable in phpString variable in php
String variable in php
 
Grep
GrepGrep
Grep
 
Python slide.1
Python slide.1Python slide.1
Python slide.1
 
php&mysql with Ethical Hacking
php&mysql with Ethical Hackingphp&mysql with Ethical Hacking
php&mysql with Ethical Hacking
 
Perl 101 - The Basics of Perl Programming
Perl  101 - The Basics of Perl ProgrammingPerl  101 - The Basics of Perl Programming
Perl 101 - The Basics of Perl Programming
 

En vedette (13)

Basic system administration tasks
Basic system administration tasksBasic system administration tasks
Basic system administration tasks
 
Basic solaris 10 system administration commands
Basic solaris 10 system administration commandsBasic solaris 10 system administration commands
Basic solaris 10 system administration commands
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
 
Linux process management
Linux process managementLinux process management
Linux process management
 
Sun solaris administration
Sun solaris administrationSun solaris administration
Sun solaris administration
 
Solaris basics
Solaris basicsSolaris basics
Solaris basics
 
Solaris vs Linux
Solaris vs LinuxSolaris vs Linux
Solaris vs Linux
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Process management in linux
Process management in linuxProcess management in linux
Process management in linux
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
 

Similaire à Unix commands

Manipulating strings
Manipulating stringsManipulating strings
Manipulating strings
Nicole Ryan
 
Chapter 13.1.3
Chapter 13.1.3Chapter 13.1.3
Chapter 13.1.3
patcha535
 

Similaire à Unix commands (20)

Plunging Into Perl While Avoiding the Deep End (mostly)
Plunging Into Perl While Avoiding the Deep End (mostly)Plunging Into Perl While Avoiding the Deep End (mostly)
Plunging Into Perl While Avoiding the Deep End (mostly)
 
String interpolation
String interpolationString interpolation
String interpolation
 
You Can Do It! Start Using Perl to Handle Your Voyager Needs
You Can Do It! Start Using Perl to Handle Your Voyager NeedsYou Can Do It! Start Using Perl to Handle Your Voyager Needs
You Can Do It! Start Using Perl to Handle Your Voyager Needs
 
Strings in c
Strings in cStrings in c
Strings in c
 
Course 102: Lecture 13: Regular Expressions
Course 102: Lecture 13: Regular Expressions Course 102: Lecture 13: Regular Expressions
Course 102: Lecture 13: Regular Expressions
 
Perl Basics with Examples
Perl Basics with ExamplesPerl Basics with Examples
Perl Basics with Examples
 
Adv. python regular expression by Rj
Adv. python regular expression by RjAdv. python regular expression by Rj
Adv. python regular expression by Rj
 
PHP Web Programming
PHP Web ProgrammingPHP Web Programming
PHP Web Programming
 
Bioinformatica: Esercizi su Perl, espressioni regolari e altre amenità (BMR G...
Bioinformatica: Esercizi su Perl, espressioni regolari e altre amenità (BMR G...Bioinformatica: Esercizi su Perl, espressioni regolari e altre amenità (BMR G...
Bioinformatica: Esercizi su Perl, espressioni regolari e altre amenità (BMR G...
 
Manipulating strings
Manipulating stringsManipulating strings
Manipulating strings
 
Python Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayPython Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard Way
 
Python regular expressions
Python regular expressionsPython regular expressions
Python regular expressions
 
Regular expressions in Python
Regular expressions in PythonRegular expressions in Python
Regular expressions in Python
 
Using Regular Expressions in Grep
Using Regular Expressions in GrepUsing Regular Expressions in Grep
Using Regular Expressions in Grep
 
Maxbox starter20
Maxbox starter20Maxbox starter20
Maxbox starter20
 
First steps in C-Shell
First steps in C-ShellFirst steps in C-Shell
First steps in C-Shell
 
Chapter 13.1.3
Chapter 13.1.3Chapter 13.1.3
Chapter 13.1.3
 
Understanding Regular expressions: Programming Historian Study Group, Univers...
Understanding Regular expressions: Programming Historian Study Group, Univers...Understanding Regular expressions: Programming Historian Study Group, Univers...
Understanding Regular expressions: Programming Historian Study Group, Univers...
 
Don't Fear the Regex - CapitalCamp/GovDays 2014
Don't Fear the Regex - CapitalCamp/GovDays 2014Don't Fear the Regex - CapitalCamp/GovDays 2014
Don't Fear the Regex - CapitalCamp/GovDays 2014
 
newperl5
newperl5newperl5
newperl5
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Unix commands

  • 1. Unix Fundamentals and command references Solaris Linux HP-UX AIX
  • 3. uname - It shows system identification information
  • 4. showrev - System information with Host ID
  • 5. # pwd – It shows the present working directory
  • 7. ls - List of directories and files
  • 10. cal - It shows calendar
  • 11. date - it shows the current date Date format : mm dd hh mm yy . s
  • 12. mkdir – to create a new directory
  • 13. cd - to change the directory
  • 14. rmdir or rm –r - to remove the directory mv – move or rename the directory or file
  • 15. mv continues … ( if destination directory already exists “ mv “ moves source directory to destination directory ).
  • 16. cp - It copies directories and files from one location to another location. “ cp “command copies only files from one location to another location. “ cp - r “ Can be used to copy directories.
  • 17. “ cat “ command is used to create or read the contents of the files. To append some more content with the existing file “ >> “ can be used.
  • 18. “ file “ is a command which tells you the property of file or Directory.
  • 19. “ more “ command displays the file contents page wise.
  • 20. “ less “ command displays the file content like “ more “ command but, it has to be closed with “ q “.
  • 21. “ touch “ is the command which creates zero length files or it puts time stamp on the file or files which are already exist.
  • 22. “ head “ command displays the file contents with “ – “option
  • 23. “ tail “ command displays file contents like “ head “ with “ - , + “ option.
  • 24. “ sort “ command displays file contents in ascending and descending order.
  • 25. “ wc - word count “ command displays words, lines, chars, bytes, mem size and all.
  • 26. “ which “ command shows the location of the commands, which are set in environment variable “ PATH “
  • 27. “ df – Disk free “ command shows the disk space level
  • 28. “ clear “ command clears the screen
  • 29. “ tty “ the terminal command shows the pseudo terminals.
  • 30. “ echo “ command show the given value or shows the value of the environment varriables.
  • 31. “ grep “ is the command which displays the line with the matching pattern. It can be executed with more options. Option Definition -i Searches for both uppercase and lowercase characters -l Lists the names of files with matching lines -n Precedes each line with the relative line number in the file -v Inverts the search to display lines that do not match the pattern -c Counts the lines that contain the pattern -w Searches for the expression as a complete word, ignoring those matches that are substrings of larger words.
  • 32. The “ grep “ command supports several regular expression Meta characters to further define a search pattern. This table describes some of the regular expression meta characters. Regular expression meta characters: Metacharacter Purpose Example Result ^ Beginning of ’^pattern’ Matches all lines line anchor beginning with “pattern” $ End of line ’pattern$’ Matches all lines anchor ending with “pattern”
  • 33. Additional regular expression meta characters: Metacharacter Purpose Example Result Matches one ’p.....n’ Matches lines . character containing a “p,” followed by Five characters, and followed by an “n” Matches the ’[a-z]*’ Matches * preceding Lowercase item zero or Alphanumeric more times characters or nothing at all
  • 34. “ grep “ continues … Metacharacter Purpose Example Result Matches one Matches lines character in ’[Pp]attern’ Containing [] “Pattern” or the pattern “pattern” Matches one Matches lines that character not do not contain “a” [^] ’[^am] in the pattern through “m” and attern’ followed by“attern”
  • 35. “ grep “ continues …
  • 36. “ grep “ continues ….
  • 37. “ grep “ continues ..
  • 38. “ grep “ continues ..
  • 39. “ grep “ continues ….
  • 40. “ grep “ continues….
  • 41. “ grep “ continues …
  • 42. Egrep The egrep command searches the contents of one or more files for a pattern using extended regular expression metacharacters. Extended regular expression metacharacters include the regular expression metacharacters that the grep command uses, plus some additional metacharacters.
  • 43. Egrep Metacharacter Purpose Sample Result + Matches one or ’[a-z]+ark’ Matches one or more more of the lowercase letters preceding followed by “ark” (for characters example, “airpark,” “bark,” “dark,” “landmark,” “shark,” “sparkle,” “trademark”) ? Matches zero ‘patte[r?]’ Matches lines or one Containing the literal character character or metacharacter it follows x|y Matches either x or ’apple | orange’ Matches for either y expression
  • 45. “ egrep “ continues…
  • 47. Pgrep The “ process grep “ command finds and displays the process ID along with It’s parent process ID.
  • 48. FIND “ find “ is a command to find a file or directory in the system globally.
  • 49. “ find “ continues …
  • 50. “ find “ continues …
  • 51. “ find “ continues …
  • 52. “ find “ continues ..
  • 53. “ w “ is a command which shows the particular user’s Information in an elaborate manner.
  • 54. “ SU “ command can be used to switch over from one user to an other user physically.
  • 55. “ who “ command shows a respective user’s information
  • 56. “ who “ continues …
  • 57. “ id “ command shows user’s ID and primary group ID
  • 58. “ finger “ command displays the user information along with user’s status
  • 59. “ Link “ is a command which creates link between source and destination file. The following example shows the symbolic link.
  • 60. “ Hard Link “ creates link between source and destination.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68. Changing file permissions in symbolic mode
  • 69. “ chmod “ continues …
  • 70. “ chmod “ continues in octal mode …
  • 71. “ chmod “ continues in octal mode…
  • 72.
  • 73. “ umask “ continues …
  • 75. The Default korn shell variables
  • 76. Customizing Korn Shell Variable To change the shell environment from Bourn shell to Korn shell :
  • 77. To change the prompt .. To change the prompt variable…
  • 80. Using VI Editor Identifying the Fundamentals of vi Editor operation • Introducing the vi editor modes of operation • The command mode • The edit mode • The last line mode • Switching between the command and edit modes • Introducing the vi command
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.
  • 88.
  • 89.
  • 90. Remote Login using TELNET and RLOGIN
  • 92. File Archives tar -c - to create tar archive -v - to get verbose -f - the out put device or directory -t - table of contents -x - extract from the tar archive
  • 93. To create tar archive Example To see the table of content
  • 94. To extract from the tar archive
  • 98. gzip To create gzip archive
  • 99. To extract the tar archive by gunzip
  • 101. Solaris User Administration Each user account consists of five main components: • User name • Password • User’s home directory • User’s login shell • User initialization files
  • 102. Managing User Accounts Before you can add user accounts to the system, you must determine the following information for each new user: • Login name • User identification (UID) number • Group identification (GID) number • Comment • home directory • Login shell • Password aging
  • 103. Storing User and Group Account information The Solaris Operating Environment stores user account and group account information in the following system files: • /etc/passwd – Authorized system users have login account entries in the /etc/passwd file. • /etc/shadow – All passwords are encrypted and maintained in a separate shadow file named /etc/shadow. • /etc/group – The /etc/group file defines the default system group accounts.
  • 104. The “ /etc/passwd “ file format root:x:0:1:Super-User:/:/sbin/sh daemon:x:1:1::/: bin:x:2:2::/usr/bin: sys:x:3:3::/: adm:x:4:4:Admin:/var/adm: lp:x:71:8:Line Printer Admin:/usr/spool/lp: smtp:x:0:0:Mail Daemon User:/: uucp:x:5:5:uucp Admin:/usr/lib/uucp: nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/ lib/uucp/uucico listen:x:37:4:Network Admin:/usr/net/nls: nobody:x:60001:60001:Nobody:/: noaccess:x:60002:60002:No Access User:/: nobody4:x:65534:65534:SunOS 4.x Nobody:/:
  • 105. The “ /etc/shadow “ file format root:LXeoktCoMtwZN:6445:::::: daemon:NP:6445:::::: bin:NP:6445:::::: sys:NP:6445:::::: adm:NP:6445:::::: lp:NP:6445:::::: smtp:NP:6445:::::: uucp:NP:6445:::::: nuucp:NP:6445:::::: listen:*LK*::::::: nobody:NP:6445:::::: noaccess:NP:6445:::::: nobody4:NP:6445::::::
  • 106. The “ /etc/group “ file format root::0:root other::1: bin::2:root,bin,daemon sys::3:root,bin,sys,adm adm::4:root,adm,daemon uucp::5:root,uucp mail::6:root tty::7:root,tty,adm lp::8:root,lp,adm nuucp::9:root,nuucp staff::10: daemon::12:root,daemon sysadmin::14:lister,torey nobody::60001: noaccess::60002: nogroup::65534:
  • 107. Command line User Account Administration The following command-line tools add, modify, and delete user accounts and group accounts on the local system: • useradd – Adds a new user account • usermod – Modifies a user’s account • userdel – Deletes a user’s account • groupadd – Adds (creates) a new group account • groupmod – Modifies a group account • groupdel – Deletes a group account
  • 108.
  • 110.
  • 112.
  • 114.
  • 116.
  • 118.
  • 121.
  • 122.