SlideShare a Scribd company logo
UNIX Operating Systems
and
Commands
Introduction
• Operating System:
 It acts as an interface between the user and
system.
 a system that manages the resources of a
computer.
• Resources:
 CPUs, Memory, I/O devices, Network etc..
Unix Architecture
 Hardware
 Kernel
 Shell
hardware
kernel
sh who
date
ed
wc
grep
as
nroff
ld
cpp
Other apps
Kernel
• Three major tasks of kernel:
 Process Management
 Device Management
 File Management
Shell
 The shell acts as an interface between
the user and the kernel
 A shell is an environment in which we
can run our commands, it is also called
as a command-line interpreter
Basic Linux Commands
• File Handling
• Text Processing
• System Administration
• Process Management
• Archival
• Network
• File Systems
• Advanced Commands
Files
 Everything in unix is considered as a file,
including the physical devices like flash
device, network cards etc..
 Logical collection of files is called as file
system or Unix file system(UFS).
 A UFS(unix file system) contains both inode
and contents of the file.
 Every file as a unique number to identify, this
number is called as an inode number.
Files…..
 We can classify files into 3
1. Ordinary Files
• Text File
• Binary File
2. Device Files
3. Directory Files / Special Files
Unix File Attributes
 File Permissions
1. Read: ‘r’ If you have read permission of a file, you
can see the contents of the file.
2. Write: ‘w’ If you have write permission of a file,
you can change the file. This means you can add to
a file, or overwrite a file. You can empty a file.
3. Execute: ‘x’ If the file has execute permission, then
you can ask the operating system to run the file as
if it were a program. If it's a binary file/program,
you can execute it like any other program.
File Attribute…
1. File type/File Permissions
2. Link
3. Owner
4. Group
5. Size
6. Last Modified Time
7. File Name
NOTE: ‘ls –l’ command lists the files in
the directory along with their attributes.
1. File type/ File permissions
 The first field of ls –l command gives the details of file type
and file permission
 This field as 10 characters.
_|_ _ _|_ _ _|_ _ _
FILE TYPE
FILE PERMISSIONS
1. FILE TYPE
the first character of the first field defines the type of the
file.
‘d’ – specifies that the file is a ‘directory file’ or a ‘special file’
‘-’ – spefies that a file is not a directory file.
 File Permissions:
Unix has three categories of file permission.
_ _ _ | _ _ _ | _ _ _
r w x r w x r w x
USER (U)
GROUP (G)
OTHER (O)
U G O
To change file Permission
 ‘chmod’ command is used to change the permissions of
the file.
USAGE: chmod [options] mode[,mode] file1 [file2 ...]
 Unix allows the user to specify modes in two ways.
1. Absolute
2. Relative
1. Absolute:
in this we use a series of 3 octal numbers to specify
the permission of a file.
Ex: chmod 501 demo.txt, chmod 777 demo.txt
 | rwx | 111 | 7 | Read, write and execute |
 | rw- | 110 | 6 | Read, write |
 | r-x | 101 | 5 | Read, and execute |
 | r-- | 100 | 4 | Read, |
 | -wx | 011 | 3 | Write and execute |
 | -w- | 010 | 2 | Write |
 | --x | 001 | 1 | Execute |
 | --- | 000 | 0 | no permissions |
+----------------------------------------------------+
 RELATIVE
In this mode ‘=‘ , ‘+’, ‘-’ operators are used to
assign, give and remove permissions.
On the LHS specify the category u,g,o,a.
On the RHS specify the permission r,w,x.
Ex: chmod u+r demo.txt
chmod u+rw demo.txt
chmod ug+rwx demo.txt
chmod a+rwx demo.txt
chmod u+rw,g+x demo.txt
INODE
 Is a data structure and it contains following details of the
file:
1. Mode/permission (protection)
2. Owner ID
3. Group ID
4. Size of file
5. Number of hard links to the file
6. Time last accessed
7. Time last modified
8. Time inode last modified
 ‘-i’ option along with ls command is used to see the
inode number of a file.
2. Link
 A link in UNIX is a pointer to a file. Like pointers in
any programming languages, links in UNIX are
pointers pointing to a file or a directory . Creating
links is a kind of shortcuts to access a file.
 It is similar to creating multiple names of the file to
access from different directories.
 The two different types of links in UNIX are:
1. Soft Links or Symbolic Links
2. Hard links
ln Command
 This command is used to create link for a file.
USAGE: ln [option] target link_name
ex: ln file1 file2
 ‘-s’ option is used to provide a soft link.
USAGE: ln –s target_file Link_name
ex: ln –s file1 file3
Hard link
 A hard link is an additional name for an existing file
on Unix-like operating systems. Any number of hard
links can be created for a file, and thus any number of
names, can be created for any file
 The inode of the hard linked file remains same as the
original file.
 On deleting the original file, hard linked file can still be
accessed.
 By giving the hard link the link count of the file will
increase.
 Hard links do not need any extra data memory to save
since it uses links
 Can be created only on files, not on directories.
Soft/Symbolic Link
 In computing, a symbolic link (soft link) is the nickname for
any file that contains a reference to another file or directory in
the form of an absolute or relative path and that affects
pathname resolution.
 Soft link can be created for non exiting file.
 oft link has a different inode number than the original file
 On deleting the original file, soft link cannot be accessed.
 Soft link needs extra memory to store the original file name as
its data.
 Access to the file is slower due to the overhead to access file.
3. Owner
 Gives the name of the owner of the file.
 We can change the owner of the file using the
command ‘chown’.
usage: chown owner file
4.Group
 Gives the name of the group a file belong to.
 We can change the group of the file using the
command ‘chgrp’.
Usage: chgrp group file
Sources to learn commands??
(man)
λ
Primary – man(manual) pages.1
2
man <command> ­ shows all information about the
command ex: man ls
<command> ­­­­help ­ shows the available options
for that command ex: ls ­­help
File Handling
commands
•
•
mkdir – is used to create directories
Usage: mkdir [OPTION]
DIRECTORY...
ex: mkdir demo
ls – is used to list all the files and
subdirectories
of the current directory.
Usage: ls [OPTION]... [FILE]...
eg. ls, ls ­l, ls ­l demo
File
Handling(contd...)
• pwd -­ print name of current working directory
Usage: pwd
• cd ­ change directories
Usage: cd [DIRECTORY]
eg. cd demo
Note: the Directory can be a relative or absolute path
of Directory
cp – copy files and directories
Usage: cp [OPTION]... SOURCE DEST
Examples:
1. cp file1 file2
cp a.txt b.txt
2. cp file 1 file2…. filen directory
cp file1 file2 /home/user/demo
mv – this command is used to move a file
from one directory to another
It is also used to rename a file.
Usage: mv [OPTION]... SOURCE DEST
eg. mv source.txt target_dir
mv old.txt new.txt
rm ­ remove files or directories
Usage: rm [OPTION]... FILE... eg. rm file1.txt , rm ­rf
some_dir
• find – search for files in a directory
hierarchy
Usage: find [OPTION] [path]
[action]
eg. 1. find file1.txt,
2. find ­­name file1.txt
• history – prints recently used commands
Usage: history
TO create an USER
 ‘addusr’ command is used to create a user.
 To create a new user the user should be logged
in as a root­user.
usage: addusr user_name
TO switch User
 ‘su’ command is used to switch from one user to another
Usage: su User_name
 It asks for the password to login.
 ‘exit’ command is used to come out of the logged in
user.
How to login as root ?
 ‘sudo su’ command is used to login as a root-user.
usage: sudo su
 It will ask for the password.
 The user should have permission to login as the root-user.
 All the users having root permissions are stored in a file
‘visudo’.
To remove User
 ‘delusr’ command is used to delete a user.
usage: delusr user-name
 You should be log-in as a root-user to delete an
user.
Basic Regular Expression
 The BRE a{1,2} matches a{1,2} literally,
while a{1,2} matches a or aa.
 As {,},+,?,(,),.. Are treated as a normal
symbols and we have to use a ‘’ to give
special meaning to them.
 As ?,+,.. Are not supported by POSIX
(Portable Operating system Interface for Unix)
BRE.
 We use grep command for BRE.
Extended Regular Expression
 The quantifiers ?, +, {n}, {n,m} and {n,} repea
t the preceding token zero or once, once or
more, n times, between n and m times, and n or
more times, respectively.
 These above quantifiers are supported by
POSIX ERE and we use egrep or grep –E
command.
Metacharacters
 ^ (Caret)=match expression at the start of a line, as in
^A.
 $ (Dollar)=match expression at the end of a line, as in
A$.
  (Back Slash)=turn off the special meaning of the next
character, as in ^.
 [ ] (Brackets)=match any one of the enclosed characters,
as in [aeiou]. Use Hyphen "-" for a range, as in [0-9].
 [^ ]=match any one character except those enclosed in
[ ], as in [^0-9].
 . (Period)=match a single character of any
value, except end of line.
 * (Asterisk)=match zero or more of the
preceding character or expression.
 {x,y}=match x to y occurrences of the
preceding.
 {x}=match exactly x occurrences of the
preceding.
 {x,}=match x or more occurrences of
the preceding.
Searching for a pattern in UINIX
 Unix has a special family of commands for handling
search requirements.
 The main member of this family is the grep
command.
GREP: (Global Regular Expression Parser)
 It scans its input for a pattern and displays lines
containing the pattern.
Examples
 grep '^From: ' demo.txt
 grep '[a-zA-Z]'{any line with at least one
letter}
 grep '[^a-zA-Z0-9]{anything not a letter or
number}
 grep '[0-9]{3}-[0-9]{4}'{999-9999, like
phone numbers}
 grep '^.$'{lines with exactly one character}
 grep '"smug"'{'smug' within double
quotes}
 grep '"*smug"*'{'smug', with or without
quotes}
 grep '^.'{any line that starts with a
Period "."}
 grep '^.[a-z][a-z]'{line start with "." and
2 letters}

More Related Content

What's hot

Basics of shell programming
Basics of shell programmingBasics of shell programming
Basics of shell programming
Chandan Kumar Rana
 
Linux file system
Linux file systemLinux file system
Linux file system
Midaga Mengistu
 
Bash shell scripting
Bash shell scriptingBash shell scripting
Bash shell scripting
VIKAS TIWARI
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1
Lilesh Pathe
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
sbmguys
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
Shakeel Shafiq
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
Geeks Anonymes
 
Linux presentation
Linux presentationLinux presentation
Linux presentationNikhil Jain
 
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Edureka!
 
User Administration in Linux
User Administration in LinuxUser Administration in Linux
User Administration in Linux
SAMUEL OJO
 
Introduction to Shell script
Introduction to Shell scriptIntroduction to Shell script
Introduction to Shell script
Bhavesh Padharia
 
Linux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell ScriptingLinux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell Scripting
Emertxe Information Technologies Pvt Ltd
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
Wave Digitech
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commands
swtjerin4u
 
Red hat linux essentials
Red hat linux essentialsRed hat linux essentials
Red hat linux essentials
Haitham Raik
 

What's hot (20)

Basics of shell programming
Basics of shell programmingBasics of shell programming
Basics of shell programming
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Bash shell scripting
Bash shell scriptingBash shell scripting
Bash shell scripting
 
Unix - Filters/Editors
Unix - Filters/EditorsUnix - Filters/Editors
Unix - Filters/Editors
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Basic 50 linus command
Basic 50 linus commandBasic 50 linus command
Basic 50 linus command
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
 
User Administration in Linux
User Administration in LinuxUser Administration in Linux
User Administration in Linux
 
Introduction to Shell script
Introduction to Shell scriptIntroduction to Shell script
Introduction to Shell script
 
IBM GPFS
IBM GPFSIBM GPFS
IBM GPFS
 
Linux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell ScriptingLinux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell Scripting
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commands
 
sed(1)
sed(1)sed(1)
sed(1)
 
Red hat linux essentials
Red hat linux essentialsRed hat linux essentials
Red hat linux essentials
 

Viewers also liked

QSpiders - Automation using Selenium
QSpiders - Automation using SeleniumQSpiders - Automation using Selenium
QSpiders - Automation using Selenium
Qspiders - Software Testing Training Institute
 
QSpiders - Selenium Webdriver
QSpiders - Selenium WebdriverQSpiders - Selenium Webdriver
QSpiders - Selenium Webdriver
Qspiders - Software Testing Training Institute
 
Unix
UnixUnix
Unix
Erm78
 
intro unix/linux 02
intro unix/linux 02intro unix/linux 02
intro unix/linux 02
duquoi
 
Unix(introduction)
Unix(introduction)Unix(introduction)
Unix(introduction)meashi
 
Unix Command Line Productivity Tips
Unix Command Line Productivity TipsUnix Command Line Productivity Tips
Unix Command Line Productivity Tips
Keith Bennett
 
Unix OS & Commands
Unix OS & CommandsUnix OS & Commands
Unix OS & Commands
Mohit Belwal
 
UNIX and Linux - an introduction by Mathias Homann
UNIX and Linux - an introduction by Mathias HomannUNIX and Linux - an introduction by Mathias Homann
UNIX and Linux - an introduction by Mathias Homann
Mathias Homann
 
Linux intro 3 grep + Unix piping
Linux intro 3 grep + Unix pipingLinux intro 3 grep + Unix piping
Linux intro 3 grep + Unix piping
Giovanni Marco Dall'Olio
 
Unix - An Introduction
Unix - An IntroductionUnix - An Introduction
Unix - An Introduction
Deepanshu Gahlaut
 
UNIX Operating System
UNIX Operating SystemUNIX Operating System
UNIX Operating System
Unless Yuriko
 
Unix memory management
Unix memory managementUnix memory management
Unix memory managementTech_MX
 
Unix command-line tools
Unix command-line toolsUnix command-line tools
Unix command-line toolsEric Wilson
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating System
subhsikha
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
Michael Olafusi
 
Practical Example of grep command in unix
Practical Example of grep command in unixPractical Example of grep command in unix
Practical Example of grep command in unix
Javin Paul
 
Data base
Data baseData base
QSpiders - Day1 Network Basics
QSpiders - Day1 Network BasicsQSpiders - Day1 Network Basics
QSpiders - Day1 Network Basics
Qspiders - Software Testing Training Institute
 
Unix Training - 1
Unix Training - 1Unix Training - 1
Unix Training - 1
ankitmehta21
 

Viewers also liked (20)

QSpiders - Automation using Selenium
QSpiders - Automation using SeleniumQSpiders - Automation using Selenium
QSpiders - Automation using Selenium
 
QSpiders - Selenium Webdriver
QSpiders - Selenium WebdriverQSpiders - Selenium Webdriver
QSpiders - Selenium Webdriver
 
Unix
UnixUnix
Unix
 
intro unix/linux 02
intro unix/linux 02intro unix/linux 02
intro unix/linux 02
 
Unix(introduction)
Unix(introduction)Unix(introduction)
Unix(introduction)
 
Unix Command Line Productivity Tips
Unix Command Line Productivity TipsUnix Command Line Productivity Tips
Unix Command Line Productivity Tips
 
Unix OS & Commands
Unix OS & CommandsUnix OS & Commands
Unix OS & Commands
 
UNIX and Linux - an introduction by Mathias Homann
UNIX and Linux - an introduction by Mathias HomannUNIX and Linux - an introduction by Mathias Homann
UNIX and Linux - an introduction by Mathias Homann
 
Linux intro 3 grep + Unix piping
Linux intro 3 grep + Unix pipingLinux intro 3 grep + Unix piping
Linux intro 3 grep + Unix piping
 
Unix - An Introduction
Unix - An IntroductionUnix - An Introduction
Unix - An Introduction
 
UNIX Operating System
UNIX Operating SystemUNIX Operating System
UNIX Operating System
 
Unix memory management
Unix memory managementUnix memory management
Unix memory management
 
Unix
UnixUnix
Unix
 
Unix command-line tools
Unix command-line toolsUnix command-line tools
Unix command-line tools
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating System
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
 
Practical Example of grep command in unix
Practical Example of grep command in unixPractical Example of grep command in unix
Practical Example of grep command in unix
 
Data base
Data baseData base
Data base
 
QSpiders - Day1 Network Basics
QSpiders - Day1 Network BasicsQSpiders - Day1 Network Basics
QSpiders - Day1 Network Basics
 
Unix Training - 1
Unix Training - 1Unix Training - 1
Unix Training - 1
 

Similar to QSpiders - Unix Operating Systems and Commands

Commands and shell programming (3)
Commands and shell programming (3)Commands and shell programming (3)
Commands and shell programming (3)
christ university
 
Unix training session 1
Unix training   session 1Unix training   session 1
Unix training session 1
Anil Kumar Kapil,PMP®
 
Unix3
Unix3Unix3
Unit 7
Unit 7Unit 7
Unit 7siddr
 
04-1-Linux.ppt
04-1-Linux.ppt04-1-Linux.ppt
04-1-Linux.ppt
EidTahir
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to LinuxDimas Prasetyo
 
Basic Linux
Basic LinuxBasic Linux
Basic Linux
Tan Huynh Cong
 
Lession1 Linux Preview
Lession1 Linux PreviewLession1 Linux Preview
Lession1 Linux Previewleminhvuong
 
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.ppt
LuigysToro
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
Sreenatha Reddy K R
 
2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx
Priyadarshini648418
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
chockit88
 
Basic unix commands_1
Basic unix commands_1Basic unix commands_1
Basic unix commands_1
thakor bharati
 
58518522 study-aix
58518522 study-aix58518522 study-aix
58518522 study-aix
homeworkping3
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unixsouthees
 
Chapter 2 Linux File System and net.pptx
Chapter 2 Linux File System and net.pptxChapter 2 Linux File System and net.pptx
Chapter 2 Linux File System and net.pptx
alehegn9
 

Similar to QSpiders - Unix Operating Systems and Commands (20)

Commands and shell programming (3)
Commands and shell programming (3)Commands and shell programming (3)
Commands and shell programming (3)
 
Unix training session 1
Unix training   session 1Unix training   session 1
Unix training session 1
 
Unix3
Unix3Unix3
Unix3
 
Unit 7
Unit 7Unit 7
Unit 7
 
04-1-Linux.ppt
04-1-Linux.ppt04-1-Linux.ppt
04-1-Linux.ppt
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
Basic Linux
Basic LinuxBasic Linux
Basic Linux
 
Lession1 Linux Preview
Lession1 Linux PreviewLession1 Linux Preview
Lession1 Linux Preview
 
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.ppt
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
 
2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
 
Linuxnishustud
LinuxnishustudLinuxnishustud
Linuxnishustud
 
Basic unix commands_1
Basic unix commands_1Basic unix commands_1
Basic unix commands_1
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
40 basic linux command
40 basic linux command40 basic linux command
40 basic linux command
 
40 basic linux command
40 basic linux command40 basic linux command
40 basic linux command
 
58518522 study-aix
58518522 study-aix58518522 study-aix
58518522 study-aix
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
 
Chapter 2 Linux File System and net.pptx
Chapter 2 Linux File System and net.pptxChapter 2 Linux File System and net.pptx
Chapter 2 Linux File System and net.pptx
 

More from Qspiders - Software Testing Training Institute

QSpiders - Variable Length-Subnet-Masks
QSpiders - Variable Length-Subnet-MasksQSpiders - Variable Length-Subnet-Masks
QSpiders - Variable Length-Subnet-Masks
Qspiders - Software Testing Training Institute
 
QSpiders - Upper layer-protocols
QSpiders - Upper layer-protocolsQSpiders - Upper layer-protocols
QSpiders - Upper layer-protocols
Qspiders - Software Testing Training Institute
 
QSpiders - Dod Model
QSpiders - Dod ModelQSpiders - Dod Model
QSpiders - Aptitude Assignments
QSpiders - Aptitude AssignmentsQSpiders - Aptitude Assignments
QSpiders - Aptitude Assignments
Qspiders - Software Testing Training Institute
 
QSpiders - SQL (Data Base)
QSpiders - SQL (Data Base)QSpiders - SQL (Data Base)
QSpiders - Chapter 7 Debugging
QSpiders - Chapter 7 DebuggingQSpiders - Chapter 7 Debugging
QSpiders - Chapter 7 Debugging
Qspiders - Software Testing Training Institute
 
QSpiders - Chapter 4 Checkpoints
QSpiders - Chapter 4 CheckpointsQSpiders - Chapter 4 Checkpoints
QSpiders - Chapter 4 Checkpoints
Qspiders - Software Testing Training Institute
 
QSpiders - Simple Recording and Configuration of recording options for HP Loa...
QSpiders - Simple Recording and Configuration of recording options for HP Loa...QSpiders - Simple Recording and Configuration of recording options for HP Loa...
QSpiders - Simple Recording and Configuration of recording options for HP Loa...
Qspiders - Software Testing Training Institute
 
QSpiders - Wonderlic Sample Question
QSpiders - Wonderlic Sample QuestionQSpiders - Wonderlic Sample Question
QSpiders - Wonderlic Sample Question
Qspiders - Software Testing Training Institute
 
QSpiders - Chapter- 3 Synchronization point
QSpiders - Chapter- 3 Synchronization pointQSpiders - Chapter- 3 Synchronization point
QSpiders - Chapter- 3 Synchronization point
Qspiders - Software Testing Training Institute
 
QSpiders - Presentation JMeter
QSpiders - Presentation JMeterQSpiders - Presentation JMeter
QSpiders - Presentation JMeter
Qspiders - Software Testing Training Institute
 
QSpiders - Memory (JVM architecture)
QSpiders - Memory (JVM architecture)QSpiders - Memory (JVM architecture)
QSpiders - Memory (JVM architecture)
Qspiders - Software Testing Training Institute
 
QSpiders - Jdk Jvm Jre and Jit
QSpiders - Jdk Jvm Jre and JitQSpiders - Jdk Jvm Jre and Jit
QSpiders - Jdk Jvm Jre and Jit
Qspiders - Software Testing Training Institute
 
QSpiders - Simple replay and run time settings Loadrunner
QSpiders - Simple replay and run time settings LoadrunnerQSpiders - Simple replay and run time settings Loadrunner
QSpiders - Simple replay and run time settings Loadrunner
Qspiders - Software Testing Training Institute
 
QSpiders - Major difference
QSpiders - Major differenceQSpiders - Major difference
QSpiders - Introduction to HP Load Runner
QSpiders - Introduction to HP Load RunnerQSpiders - Introduction to HP Load Runner
QSpiders - Introduction to HP Load Runner
Qspiders - Software Testing Training Institute
 
QSpiders - Interacting with My SQL Database
QSpiders - Interacting with My SQL DatabaseQSpiders - Interacting with My SQL Database
QSpiders - Interacting with My SQL Database
Qspiders - Software Testing Training Institute
 
QSpiders - Server Architecture
QSpiders - Server ArchitectureQSpiders - Server Architecture
QSpiders - Server Architecture
Qspiders - Software Testing Training Institute
 
QSpiders - Installation and Brief Dose of Load Runner
QSpiders - Installation and Brief Dose of Load RunnerQSpiders - Installation and Brief Dose of Load Runner
QSpiders - Installation and Brief Dose of Load Runner
Qspiders - Software Testing Training Institute
 
QSpiders - Good to Know Network Concepts
QSpiders - Good to Know Network ConceptsQSpiders - Good to Know Network Concepts
QSpiders - Good to Know Network Concepts
Qspiders - Software Testing Training Institute
 

More from Qspiders - Software Testing Training Institute (20)

QSpiders - Variable Length-Subnet-Masks
QSpiders - Variable Length-Subnet-MasksQSpiders - Variable Length-Subnet-Masks
QSpiders - Variable Length-Subnet-Masks
 
QSpiders - Upper layer-protocols
QSpiders - Upper layer-protocolsQSpiders - Upper layer-protocols
QSpiders - Upper layer-protocols
 
QSpiders - Dod Model
QSpiders - Dod ModelQSpiders - Dod Model
QSpiders - Dod Model
 
QSpiders - Aptitude Assignments
QSpiders - Aptitude AssignmentsQSpiders - Aptitude Assignments
QSpiders - Aptitude Assignments
 
QSpiders - SQL (Data Base)
QSpiders - SQL (Data Base)QSpiders - SQL (Data Base)
QSpiders - SQL (Data Base)
 
QSpiders - Chapter 7 Debugging
QSpiders - Chapter 7 DebuggingQSpiders - Chapter 7 Debugging
QSpiders - Chapter 7 Debugging
 
QSpiders - Chapter 4 Checkpoints
QSpiders - Chapter 4 CheckpointsQSpiders - Chapter 4 Checkpoints
QSpiders - Chapter 4 Checkpoints
 
QSpiders - Simple Recording and Configuration of recording options for HP Loa...
QSpiders - Simple Recording and Configuration of recording options for HP Loa...QSpiders - Simple Recording and Configuration of recording options for HP Loa...
QSpiders - Simple Recording and Configuration of recording options for HP Loa...
 
QSpiders - Wonderlic Sample Question
QSpiders - Wonderlic Sample QuestionQSpiders - Wonderlic Sample Question
QSpiders - Wonderlic Sample Question
 
QSpiders - Chapter- 3 Synchronization point
QSpiders - Chapter- 3 Synchronization pointQSpiders - Chapter- 3 Synchronization point
QSpiders - Chapter- 3 Synchronization point
 
QSpiders - Presentation JMeter
QSpiders - Presentation JMeterQSpiders - Presentation JMeter
QSpiders - Presentation JMeter
 
QSpiders - Memory (JVM architecture)
QSpiders - Memory (JVM architecture)QSpiders - Memory (JVM architecture)
QSpiders - Memory (JVM architecture)
 
QSpiders - Jdk Jvm Jre and Jit
QSpiders - Jdk Jvm Jre and JitQSpiders - Jdk Jvm Jre and Jit
QSpiders - Jdk Jvm Jre and Jit
 
QSpiders - Simple replay and run time settings Loadrunner
QSpiders - Simple replay and run time settings LoadrunnerQSpiders - Simple replay and run time settings Loadrunner
QSpiders - Simple replay and run time settings Loadrunner
 
QSpiders - Major difference
QSpiders - Major differenceQSpiders - Major difference
QSpiders - Major difference
 
QSpiders - Introduction to HP Load Runner
QSpiders - Introduction to HP Load RunnerQSpiders - Introduction to HP Load Runner
QSpiders - Introduction to HP Load Runner
 
QSpiders - Interacting with My SQL Database
QSpiders - Interacting with My SQL DatabaseQSpiders - Interacting with My SQL Database
QSpiders - Interacting with My SQL Database
 
QSpiders - Server Architecture
QSpiders - Server ArchitectureQSpiders - Server Architecture
QSpiders - Server Architecture
 
QSpiders - Installation and Brief Dose of Load Runner
QSpiders - Installation and Brief Dose of Load RunnerQSpiders - Installation and Brief Dose of Load Runner
QSpiders - Installation and Brief Dose of Load Runner
 
QSpiders - Good to Know Network Concepts
QSpiders - Good to Know Network ConceptsQSpiders - Good to Know Network Concepts
QSpiders - Good to Know Network Concepts
 

Recently uploaded

Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 

Recently uploaded (20)

Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 

QSpiders - Unix Operating Systems and Commands

  • 2. Introduction • Operating System:  It acts as an interface between the user and system.  a system that manages the resources of a computer. • Resources:  CPUs, Memory, I/O devices, Network etc..
  • 3. Unix Architecture  Hardware  Kernel  Shell hardware kernel sh who date ed wc grep as nroff ld cpp Other apps
  • 4. Kernel • Three major tasks of kernel:  Process Management  Device Management  File Management
  • 5. Shell  The shell acts as an interface between the user and the kernel  A shell is an environment in which we can run our commands, it is also called as a command-line interpreter
  • 6. Basic Linux Commands • File Handling • Text Processing • System Administration • Process Management • Archival • Network • File Systems • Advanced Commands
  • 7. Files  Everything in unix is considered as a file, including the physical devices like flash device, network cards etc..  Logical collection of files is called as file system or Unix file system(UFS).  A UFS(unix file system) contains both inode and contents of the file.  Every file as a unique number to identify, this number is called as an inode number.
  • 8. Files…..  We can classify files into 3 1. Ordinary Files • Text File • Binary File 2. Device Files 3. Directory Files / Special Files
  • 9. Unix File Attributes  File Permissions 1. Read: ‘r’ If you have read permission of a file, you can see the contents of the file. 2. Write: ‘w’ If you have write permission of a file, you can change the file. This means you can add to a file, or overwrite a file. You can empty a file. 3. Execute: ‘x’ If the file has execute permission, then you can ask the operating system to run the file as if it were a program. If it's a binary file/program, you can execute it like any other program.
  • 10. File Attribute… 1. File type/File Permissions 2. Link 3. Owner 4. Group 5. Size 6. Last Modified Time 7. File Name NOTE: ‘ls –l’ command lists the files in the directory along with their attributes.
  • 11. 1. File type/ File permissions  The first field of ls –l command gives the details of file type and file permission  This field as 10 characters. _|_ _ _|_ _ _|_ _ _ FILE TYPE FILE PERMISSIONS 1. FILE TYPE the first character of the first field defines the type of the file. ‘d’ – specifies that the file is a ‘directory file’ or a ‘special file’ ‘-’ – spefies that a file is not a directory file.
  • 12.  File Permissions: Unix has three categories of file permission. _ _ _ | _ _ _ | _ _ _ r w x r w x r w x USER (U) GROUP (G) OTHER (O) U G O
  • 13. To change file Permission  ‘chmod’ command is used to change the permissions of the file. USAGE: chmod [options] mode[,mode] file1 [file2 ...]  Unix allows the user to specify modes in two ways. 1. Absolute 2. Relative 1. Absolute: in this we use a series of 3 octal numbers to specify the permission of a file. Ex: chmod 501 demo.txt, chmod 777 demo.txt
  • 14.  | rwx | 111 | 7 | Read, write and execute |  | rw- | 110 | 6 | Read, write |  | r-x | 101 | 5 | Read, and execute |  | r-- | 100 | 4 | Read, |  | -wx | 011 | 3 | Write and execute |  | -w- | 010 | 2 | Write |  | --x | 001 | 1 | Execute |  | --- | 000 | 0 | no permissions | +----------------------------------------------------+
  • 15.  RELATIVE In this mode ‘=‘ , ‘+’, ‘-’ operators are used to assign, give and remove permissions. On the LHS specify the category u,g,o,a. On the RHS specify the permission r,w,x. Ex: chmod u+r demo.txt chmod u+rw demo.txt chmod ug+rwx demo.txt chmod a+rwx demo.txt chmod u+rw,g+x demo.txt
  • 16. INODE  Is a data structure and it contains following details of the file: 1. Mode/permission (protection) 2. Owner ID 3. Group ID 4. Size of file 5. Number of hard links to the file 6. Time last accessed 7. Time last modified 8. Time inode last modified  ‘-i’ option along with ls command is used to see the inode number of a file.
  • 17. 2. Link  A link in UNIX is a pointer to a file. Like pointers in any programming languages, links in UNIX are pointers pointing to a file or a directory . Creating links is a kind of shortcuts to access a file.  It is similar to creating multiple names of the file to access from different directories.  The two different types of links in UNIX are: 1. Soft Links or Symbolic Links 2. Hard links
  • 18. ln Command  This command is used to create link for a file. USAGE: ln [option] target link_name ex: ln file1 file2  ‘-s’ option is used to provide a soft link. USAGE: ln –s target_file Link_name ex: ln –s file1 file3
  • 19. Hard link  A hard link is an additional name for an existing file on Unix-like operating systems. Any number of hard links can be created for a file, and thus any number of names, can be created for any file  The inode of the hard linked file remains same as the original file.  On deleting the original file, hard linked file can still be accessed.  By giving the hard link the link count of the file will increase.  Hard links do not need any extra data memory to save since it uses links  Can be created only on files, not on directories.
  • 20. Soft/Symbolic Link  In computing, a symbolic link (soft link) is the nickname for any file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution.  Soft link can be created for non exiting file.  oft link has a different inode number than the original file  On deleting the original file, soft link cannot be accessed.  Soft link needs extra memory to store the original file name as its data.  Access to the file is slower due to the overhead to access file.
  • 21. 3. Owner  Gives the name of the owner of the file.  We can change the owner of the file using the command ‘chown’. usage: chown owner file
  • 22. 4.Group  Gives the name of the group a file belong to.  We can change the group of the file using the command ‘chgrp’. Usage: chgrp group file
  • 23. Sources to learn commands?? (man) λ Primary – man(manual) pages.1 2 man <command> ­ shows all information about the command ex: man ls <command> ­­­­help ­ shows the available options for that command ex: ls ­­help
  • 24. File Handling commands • • mkdir – is used to create directories Usage: mkdir [OPTION] DIRECTORY... ex: mkdir demo ls – is used to list all the files and subdirectories of the current directory. Usage: ls [OPTION]... [FILE]... eg. ls, ls ­l, ls ­l demo
  • 25. File Handling(contd...) • pwd -­ print name of current working directory Usage: pwd • cd ­ change directories Usage: cd [DIRECTORY] eg. cd demo Note: the Directory can be a relative or absolute path of Directory
  • 26. cp – copy files and directories Usage: cp [OPTION]... SOURCE DEST Examples: 1. cp file1 file2 cp a.txt b.txt 2. cp file 1 file2…. filen directory cp file1 file2 /home/user/demo
  • 27. mv – this command is used to move a file from one directory to another It is also used to rename a file. Usage: mv [OPTION]... SOURCE DEST eg. mv source.txt target_dir mv old.txt new.txt rm ­ remove files or directories Usage: rm [OPTION]... FILE... eg. rm file1.txt , rm ­rf some_dir
  • 28. • find – search for files in a directory hierarchy Usage: find [OPTION] [path] [action] eg. 1. find file1.txt, 2. find ­­name file1.txt • history – prints recently used commands Usage: history
  • 29. TO create an USER  ‘addusr’ command is used to create a user.  To create a new user the user should be logged in as a root­user. usage: addusr user_name
  • 30. TO switch User  ‘su’ command is used to switch from one user to another Usage: su User_name  It asks for the password to login.  ‘exit’ command is used to come out of the logged in user.
  • 31. How to login as root ?  ‘sudo su’ command is used to login as a root-user. usage: sudo su  It will ask for the password.  The user should have permission to login as the root-user.  All the users having root permissions are stored in a file ‘visudo’.
  • 32. To remove User  ‘delusr’ command is used to delete a user. usage: delusr user-name  You should be log-in as a root-user to delete an user.
  • 33. Basic Regular Expression  The BRE a{1,2} matches a{1,2} literally, while a{1,2} matches a or aa.  As {,},+,?,(,),.. Are treated as a normal symbols and we have to use a ‘’ to give special meaning to them.  As ?,+,.. Are not supported by POSIX (Portable Operating system Interface for Unix) BRE.  We use grep command for BRE.
  • 34. Extended Regular Expression  The quantifiers ?, +, {n}, {n,m} and {n,} repea t the preceding token zero or once, once or more, n times, between n and m times, and n or more times, respectively.  These above quantifiers are supported by POSIX ERE and we use egrep or grep –E command.
  • 35. Metacharacters  ^ (Caret)=match expression at the start of a line, as in ^A.  $ (Dollar)=match expression at the end of a line, as in A$.  (Back Slash)=turn off the special meaning of the next character, as in ^.  [ ] (Brackets)=match any one of the enclosed characters, as in [aeiou]. Use Hyphen "-" for a range, as in [0-9].  [^ ]=match any one character except those enclosed in [ ], as in [^0-9].
  • 36.  . (Period)=match a single character of any value, except end of line.  * (Asterisk)=match zero or more of the preceding character or expression.  {x,y}=match x to y occurrences of the preceding.  {x}=match exactly x occurrences of the preceding.  {x,}=match x or more occurrences of the preceding.
  • 37. Searching for a pattern in UINIX  Unix has a special family of commands for handling search requirements.  The main member of this family is the grep command. GREP: (Global Regular Expression Parser)  It scans its input for a pattern and displays lines containing the pattern.
  • 38. Examples  grep '^From: ' demo.txt  grep '[a-zA-Z]'{any line with at least one letter}  grep '[^a-zA-Z0-9]{anything not a letter or number}  grep '[0-9]{3}-[0-9]{4}'{999-9999, like phone numbers}  grep '^.$'{lines with exactly one character}
  • 39.  grep '"smug"'{'smug' within double quotes}  grep '"*smug"*'{'smug', with or without quotes}  grep '^.'{any line that starts with a Period "."}  grep '^.[a-z][a-z]'{line start with "." and 2 letters}