SlideShare a Scribd company logo
1 of 32
Download to read offline
Chapter 0Chapter 0
Command LineCommand Line
InterfaceInterface
kernel
hardware
shell
Shell DefinitionShell Definition
●
Command interpreter:Command interpreter:
●
Issue commands from user to systemIssue commands from user to system
●
Display command results from system to userDisplay command results from system to user
Available Shells in LinuxAvailable Shells in Linux
●
sh:sh:
●
Burne Shell (sh)Burne Shell (sh)
●
Burne Again Shell (bash)Burne Again Shell (bash)
●
csh:csh:
●
C Shell (csh)C Shell (csh)
●
TC Shell (tcsh)TC Shell (tcsh)
●
Korn Shell (ksh)Korn Shell (ksh)
●
/etc/shells/etc/shells
Ref. Pge. 5
Accessing a ShellAccessing a Shell
●
TTY (TTY ( teletype - the original terminalsteletype - the original terminals ))
  Ctrl­alt­F[1­6]Ctrl­alt­F[1­6]
● Login:Login:
● Passowrd:Passowrd:
●
X-termX-term
●
Login GUILogin GUI
●
Launch terminal programLaunch terminal program
Shell PromptShell Prompt
●
Function:Function:
Telling the user:Telling the user:
You can type command now!You can type command now!
●
Style:Style:
●
Super User:Super User: ##
●
Regular User:Regular User: $$ oror > >
Carriage Return (CR)Carriage Return (CR)
●
Function:Function:
Telling the system:Telling the system:
You can run command now!You can run command now!
●
Generated by:Generated by:
<Enter><Enter>
Command LineCommand Line
●
Everything typed between ShellEverything typed between Shell
Prompt and Carriage Return.Prompt and Carriage Return.
Command Line ComponentsCommand Line Components
●
A Command (must present):A Command (must present):
What to do?What to do?
●
Options (zero or more):Options (zero or more):
How to do?How to do?
●
Arguments (zero or more):Arguments (zero or more):
Which to do with?Which to do with?
Internal Field Separator (IFS)Internal Field Separator (IFS)
●
Function:Function:
To separate command line components.To separate command line components.
●
Speak in general:Speak in general:
To cut a command line into words(fields).To cut a command line into words(fields).
●
Generated by:Generated by:
● <Space><Space>
● <Tab><Tab>
● <Enter><Enter> (*note: CR also)(*note: CR also)
A Command Line FormatA Command Line Format
CommandCommand<IFS>[<IFS>[Options...]Options...]<IFS>[<IFS>[Arguments...]Arguments...]
Option FormatOption Format
●
Preceding Character:Preceding Character:
­­
++
●
Full Format:Full Format:
Starting withStarting with ­­­­
●
Short Format:Short Format:
Starting withStarting with ­ ­
CombinableCombinable
Option ExampleOption Example
●
Find the difference:Find the difference:
ls ­a ­l lls ­a ­l l
ls ­al lls ­al l
ls ­allls ­all
ls ­­allls ­­all
ls ­­ ­­allls ­­ ­­all
A Simple Command:A Simple Command: echoecho
●
Function:Function:
To display all arguments to STDOUT(screen),To display all arguments to STDOUT(screen),
plus an endingplus an ending <newline><newline> character.character.
A Simple Command:A Simple Command: echoecho
●
Major options:Major options:
­n ­n : disable the trailing: disable the trailing <newline><newline>
­e ­e : enable interpretation of escapes (: enable interpretation of escapes ())
Escaped Characters inEscaped Characters in echoecho
●
Most Frequently Used:Most Frequently Used:
 backslash backslash
b backspaceb backspace
c produce no further outputc produce no further output
n new linen new line
r carriage returnr carriage return
t horizontal tabt horizontal tab
v vertical tabv vertical tab
0NNN byte with octal value0NNN byte with octal value
xHH byte with hexadecimal valuexHH byte with hexadecimal value
Examples ofExamples of echoecho
●
UsingUsing ­n­n option:option:
$ echo first line $ echo first line 
first line first line 
$ echo ­n first line $ echo ­n first line 
first line $first line $  
Examples ofExamples of echoecho
●
Using escape character:Using escape character:
$ echo ­e "atbtcndtetf" $ echo ­e "atbtcndtetf" 
a       b       c a       b       c 
d       e       f d       e       f   
Examples ofExamples of echoecho
●
Using escape with octal value:Using escape with octal value:
$ echo ­e $ echo ­e 
"141011142011143012144011145"141011142011143012144011145
011146" 011146" 
a       b       c a       b       c 
d       e       f  d       e       f    
Examples ofExamples of echoecho
●
Using escape with hex value:Using escape with hex value:
$ echo ­e $ echo ­e 
"x61x09x62x09x63x0ax64x09x65"x61x09x62x09x63x0ax64x09x65
x09x66" x09x66" 
a       b       c a       b       c 
d       e       f   d       e       f     
Character Type in Command LineCharacter Type in Command Line
●
Literal Character:Literal Character:
Plain text, no functionPlain text, no function
123456 abcdefg …123456 abcdefg …
●
Meta Character:Meta Character:
Reserved with functionsReserved with functions
Frequently Used Meta CharactersFrequently Used Meta Characters
= =  :: set variable valueset variable value
$ $  :: variable substitutionvariable substitution
> >  :: redirect to STDOUTredirect to STDOUT
< <  :: redirect from STDINredirect from STDIN
| |  :: pipe linepipe line
& &  :: background runningbackground running
()() :: run commands in nested sub-shellrun commands in nested sub-shell
{}{} :: command groupingcommand grouping
; ;  :: run commands in frequencyrun commands in frequency
&&&& :: run command while TRUErun command while TRUE
|||| :: run command while FALSErun command while FALSE
!! :: re-run command in historyre-run command in history
Quoting UsageQuoting Usage
●
Purpose:Purpose:
Disable the functions of Meta Characters.Disable the functions of Meta Characters.
Quoting MethodQuoting Method
●
Escaping (Escaping (  ):):
Disable meta character following backwardDisable meta character following backward
slash by each.slash by each.
●
Example:Example:
$$
((

<newline><newline>
Quoting MethodQuoting Method
●
Hard Quoting (Hard Quoting ( '''' ):):
Disable all meta characters within singleDisable all meta characters within single
quotes.quotes.
●
Example:Example:
'...$...(...)...''...$...(...)...'
Quoting MethodQuoting Method
●
Soft Quoting (Soft Quoting ( ”””” ):):
Disable some meta characters within doubleDisable some meta characters within double
quotes.quotes.
●
Example:Example:
““...$...(...)......$...(...)...““
Exception in Soft QuotingException in Soft Quoting
●
Reserved functions:Reserved functions:
$ $ : substitute: substitute
  : escape: escape
` ` : command substitute: command substitute
!!  : history: history
Quoting ExampleQuoting Example
●
DisableDisable <IFS><IFS>::
$ A=B C$ A=B C # white space # white space 
C: command not found.C: command not found.
$ echo $A$ echo $A
$ A="B C"$ A="B C"
$ echo $A$ echo $A
B C B C 
Quoting ExampleQuoting Example
●
DisableDisable <CR><CR>::
$ A='B $ A='B 
> C> C
> '> '
$ echo "$A"$ echo "$A"
BB
C C   
Quoting ExampleQuoting Example
●
Think about:Think about:
$ echo "$A"$ echo "$A"
BB
C C   
$ echo $A$ echo $A
B CB C  
Quoting ExampleQuoting Example
●
Think about:Think about:
$ A=B C$ A=B C
$ echo '”$A”'$ echo '”$A”'
””$A”$A”
$ echo “'$A'“$ echo “'$A'“
'B C''B C'  
Quoting ExampleQuoting Example
●
Identical:Identical:
$ awk '{print $0}' 1.txt$ awk '{print $0}' 1.txt
$ awk "{print $0}" 1.txt$ awk "{print $0}" 1.txt
$ awk {print $0} 1.txt$ awk {print $0} 1.txt
$ A=0$ A=0
$ awk "{print $$A}" 1.txt$ awk "{print $$A}" 1.txt

More Related Content

What's hot

Linux Commands - Cheat Sheet
Linux Commands - Cheat Sheet Linux Commands - Cheat Sheet
Linux Commands - Cheat Sheet Isham Rashik
 
2.1.using the shell
2.1.using the shell2.1.using the shell
2.1.using the shelldonv214
 
Lecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationLecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationMohammed Farrag
 
101 3.5 create, monitor and kill processes
101 3.5 create, monitor and kill processes101 3.5 create, monitor and kill processes
101 3.5 create, monitor and kill processesAcácio Oliveira
 
Linux tech talk
Linux tech talkLinux tech talk
Linux tech talkPrince Raj
 
Unit 10 investigating and managing
Unit 10 investigating and managingUnit 10 investigating and managing
Unit 10 investigating and managingroot_fibo
 
Perl - laziness, impatience, hubris, and one liners
Perl - laziness, impatience, hubris, and one linersPerl - laziness, impatience, hubris, and one liners
Perl - laziness, impatience, hubris, and one linersKirk Kimmel
 
nouka inventry manager
nouka inventry managernouka inventry manager
nouka inventry managerToshiaki Baba
 
agri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertoragri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertorToshiaki Baba
 
Redis as a message queue
Redis as a message queueRedis as a message queue
Redis as a message queueBrandon Lamb
 
Redis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your applicationRedis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your applicationrjsmelo
 
Msfpayload/Msfencoder cheatsheet
Msfpayload/Msfencoder cheatsheetMsfpayload/Msfencoder cheatsheet
Msfpayload/Msfencoder cheatsheetCe.Se.N.A. Security
 
101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirects101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirectsAcácio Oliveira
 
3.2 process text streams using filters
3.2 process text streams using filters3.2 process text streams using filters
3.2 process text streams using filtersAcácio Oliveira
 

What's hot (20)

Puppet
PuppetPuppet
Puppet
 
Linux Commands - Cheat Sheet
Linux Commands - Cheat Sheet Linux Commands - Cheat Sheet
Linux Commands - Cheat Sheet
 
2.1.using the shell
2.1.using the shell2.1.using the shell
2.1.using the shell
 
Lecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationLecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administration
 
101 3.5 create, monitor and kill processes
101 3.5 create, monitor and kill processes101 3.5 create, monitor and kill processes
101 3.5 create, monitor and kill processes
 
Linux tech talk
Linux tech talkLinux tech talk
Linux tech talk
 
Unit 10 investigating and managing
Unit 10 investigating and managingUnit 10 investigating and managing
Unit 10 investigating and managing
 
Perl - laziness, impatience, hubris, and one liners
Perl - laziness, impatience, hubris, and one linersPerl - laziness, impatience, hubris, and one liners
Perl - laziness, impatience, hubris, and one liners
 
nouka inventry manager
nouka inventry managernouka inventry manager
nouka inventry manager
 
agri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertoragri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertor
 
Rpm Introduction
Rpm IntroductionRpm Introduction
Rpm Introduction
 
Redis as a message queue
Redis as a message queueRedis as a message queue
Redis as a message queue
 
XS Boston 2008 Debugging Xen
XS Boston 2008 Debugging XenXS Boston 2008 Debugging Xen
XS Boston 2008 Debugging Xen
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 
Redis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your applicationRedis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your application
 
Shellprogramming
ShellprogrammingShellprogramming
Shellprogramming
 
Msfpayload/Msfencoder cheatsheet
Msfpayload/Msfencoder cheatsheetMsfpayload/Msfencoder cheatsheet
Msfpayload/Msfencoder cheatsheet
 
101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirects101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirects
 
Unix - Shell Scripts
Unix - Shell ScriptsUnix - Shell Scripts
Unix - Shell Scripts
 
3.2 process text streams using filters
3.2 process text streams using filters3.2 process text streams using filters
3.2 process text streams using filters
 

Viewers also liked

Linux fundamental - Chap 13 account management
Linux fundamental - Chap 13 account managementLinux fundamental - Chap 13 account management
Linux fundamental - Chap 13 account managementKenny (netman)
 
Linux fundamental - Chap 07 vi
Linux fundamental - Chap 07 viLinux fundamental - Chap 07 vi
Linux fundamental - Chap 07 viKenny (netman)
 
Linux fundamentals
Linux fundamentalsLinux fundamentals
Linux fundamentalschakrikolla
 
Linux fundamental - Chap 03 file
Linux fundamental - Chap 03 fileLinux fundamental - Chap 03 file
Linux fundamental - Chap 03 fileKenny (netman)
 
Linux fundamental - Chap 08 proc
Linux fundamental - Chap 08 procLinux fundamental - Chap 08 proc
Linux fundamental - Chap 08 procKenny (netman)
 
Linux network monitoring hands-on pratice
Linux network monitoring hands-on praticeLinux network monitoring hands-on pratice
Linux network monitoring hands-on praticeKenny (netman)
 
Linux: Beyond ls and cd
Linux: Beyond ls and cdLinux: Beyond ls and cd
Linux: Beyond ls and cdjacko91
 
Linux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archiveLinux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archiveKenny (netman)
 
Linux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regxLinux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regxKenny (netman)
 
Linux fundamental - Chap 11 boot
Linux fundamental - Chap 11 bootLinux fundamental - Chap 11 boot
Linux fundamental - Chap 11 bootKenny (netman)
 
Linux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fsLinux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fsKenny (netman)
 
Linux fundamental - Chap 01 io
Linux fundamental - Chap 01 ioLinux fundamental - Chap 01 io
Linux fundamental - Chap 01 ioKenny (netman)
 
Linux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementLinux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementKenny (netman)
 
Linux fundamental - Chap 02 perm
Linux fundamental - Chap 02 permLinux fundamental - Chap 02 perm
Linux fundamental - Chap 02 permKenny (netman)
 
Linux fundamentals
Linux fundamentalsLinux fundamentals
Linux fundamentalsRaghu nath
 

Viewers also liked (20)

Linux fundamental - Chap 13 account management
Linux fundamental - Chap 13 account managementLinux fundamental - Chap 13 account management
Linux fundamental - Chap 13 account management
 
Linux fundamental - Chap 07 vi
Linux fundamental - Chap 07 viLinux fundamental - Chap 07 vi
Linux fundamental - Chap 07 vi
 
Linux fundamentals
Linux fundamentalsLinux fundamentals
Linux fundamentals
 
About the Course
About the CourseAbout the Course
About the Course
 
Linux fundamental - Chap 03 file
Linux fundamental - Chap 03 fileLinux fundamental - Chap 03 file
Linux fundamental - Chap 03 file
 
Linux fundamental - Chap 08 proc
Linux fundamental - Chap 08 procLinux fundamental - Chap 08 proc
Linux fundamental - Chap 08 proc
 
Linux network monitoring hands-on pratice
Linux network monitoring hands-on praticeLinux network monitoring hands-on pratice
Linux network monitoring hands-on pratice
 
Linux: Beyond ls and cd
Linux: Beyond ls and cdLinux: Beyond ls and cd
Linux: Beyond ls and cd
 
Linux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archiveLinux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archive
 
Linux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regxLinux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regx
 
Linux fundamental - Chap 11 boot
Linux fundamental - Chap 11 bootLinux fundamental - Chap 11 boot
Linux fundamental - Chap 11 boot
 
Linux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fsLinux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fs
 
Linux CLI
Linux CLILinux CLI
Linux CLI
 
Linux fundamental - Chap 01 io
Linux fundamental - Chap 01 ioLinux fundamental - Chap 01 io
Linux fundamental - Chap 01 io
 
Linux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementLinux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware Management
 
Chap 17 advfs
Chap 17 advfsChap 17 advfs
Chap 17 advfs
 
Linux fundamental - Chap 02 perm
Linux fundamental - Chap 02 permLinux fundamental - Chap 02 perm
Linux fundamental - Chap 02 perm
 
Linux fundamentals
Linux fundamentalsLinux fundamentals
Linux fundamentals
 
Ha opensuse
Ha opensuseHa opensuse
Ha opensuse
 
Chap 19 web
Chap 19 webChap 19 web
Chap 19 web
 

Similar to Linux fundamental - Chap 00 shell

Similar to Linux fundamental - Chap 00 shell (20)

Linux shell
Linux shellLinux shell
Linux shell
 
Sdl Basic
Sdl BasicSdl Basic
Sdl Basic
 
lec4.docx
lec4.docxlec4.docx
lec4.docx
 
3.1 gnu and unix commands v4
3.1 gnu and unix commands v43.1 gnu and unix commands v4
3.1 gnu and unix commands v4
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash script
 
C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
 
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpoint
 
Compiler design notes phases of compiler
Compiler design notes phases of compilerCompiler design notes phases of compiler
Compiler design notes phases of compiler
 
101 3.1 gnu and unix commands v4
101 3.1 gnu and unix commands v4101 3.1 gnu and unix commands v4
101 3.1 gnu and unix commands v4
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial
 
Specialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingSpecialized Compiler for Hash Cracking
Specialized Compiler for Hash Cracking
 
cmp104 lec 8
cmp104 lec 8cmp104 lec 8
cmp104 lec 8
 
ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Doscommands
DoscommandsDoscommands
Doscommands
 
Doscommands
DoscommandsDoscommands
Doscommands
 
Unit 6 bash shell
Unit 6 bash shellUnit 6 bash shell
Unit 6 bash shell
 

More from Kenny (netman)

rpi_audio configuration steps
rpi_audio configuration stepsrpi_audio configuration steps
rpi_audio configuration stepsKenny (netman)
 
Linux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System RescueLinux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System RescueKenny (netman)
 
Linux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job SchedulingLinux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job SchedulingKenny (netman)
 
Linux Network Monitoring
Linux Network MonitoringLinux Network Monitoring
Linux Network MonitoringKenny (netman)
 

More from Kenny (netman) (10)

rpi_audio configuration steps
rpi_audio configuration stepsrpi_audio configuration steps
rpi_audio configuration steps
 
Rpi audio
Rpi audioRpi audio
Rpi audio
 
Chap 18 net
Chap 18 netChap 18 net
Chap 18 net
 
Linux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System RescueLinux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System Rescue
 
Linux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job SchedulingLinux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job Scheduling
 
Linux system security
Linux system securityLinux system security
Linux system security
 
Linux Network Monitoring
Linux Network MonitoringLinux Network Monitoring
Linux Network Monitoring
 
加密應用(GPG)
加密應用(GPG)加密應用(GPG)
加密應用(GPG)
 
金鑰管理 (PKI)
金鑰管理 (PKI)金鑰管理 (PKI)
金鑰管理 (PKI)
 
Linux firewall
Linux firewallLinux firewall
Linux firewall
 

Recently uploaded

Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 

Recently uploaded (20)

Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 

Linux fundamental - Chap 00 shell

  • 1. Chapter 0Chapter 0 Command LineCommand Line
  • 3. Shell DefinitionShell Definition ● Command interpreter:Command interpreter: ● Issue commands from user to systemIssue commands from user to system ● Display command results from system to userDisplay command results from system to user
  • 4. Available Shells in LinuxAvailable Shells in Linux ● sh:sh: ● Burne Shell (sh)Burne Shell (sh) ● Burne Again Shell (bash)Burne Again Shell (bash) ● csh:csh: ● C Shell (csh)C Shell (csh) ● TC Shell (tcsh)TC Shell (tcsh) ● Korn Shell (ksh)Korn Shell (ksh) ● /etc/shells/etc/shells Ref. Pge. 5
  • 5. Accessing a ShellAccessing a Shell ● TTY (TTY ( teletype - the original terminalsteletype - the original terminals ))   Ctrl­alt­F[1­6]Ctrl­alt­F[1­6] ● Login:Login: ● Passowrd:Passowrd: ● X-termX-term ● Login GUILogin GUI ● Launch terminal programLaunch terminal program
  • 6. Shell PromptShell Prompt ● Function:Function: Telling the user:Telling the user: You can type command now!You can type command now! ● Style:Style: ● Super User:Super User: ## ● Regular User:Regular User: $$ oror > >
  • 7. Carriage Return (CR)Carriage Return (CR) ● Function:Function: Telling the system:Telling the system: You can run command now!You can run command now! ● Generated by:Generated by: <Enter><Enter>
  • 8. Command LineCommand Line ● Everything typed between ShellEverything typed between Shell Prompt and Carriage Return.Prompt and Carriage Return.
  • 9. Command Line ComponentsCommand Line Components ● A Command (must present):A Command (must present): What to do?What to do? ● Options (zero or more):Options (zero or more): How to do?How to do? ● Arguments (zero or more):Arguments (zero or more): Which to do with?Which to do with?
  • 10. Internal Field Separator (IFS)Internal Field Separator (IFS) ● Function:Function: To separate command line components.To separate command line components. ● Speak in general:Speak in general: To cut a command line into words(fields).To cut a command line into words(fields). ● Generated by:Generated by: ● <Space><Space> ● <Tab><Tab> ● <Enter><Enter> (*note: CR also)(*note: CR also)
  • 11. A Command Line FormatA Command Line Format CommandCommand<IFS>[<IFS>[Options...]Options...]<IFS>[<IFS>[Arguments...]Arguments...]
  • 12. Option FormatOption Format ● Preceding Character:Preceding Character: ­­ ++ ● Full Format:Full Format: Starting withStarting with ­­­­ ● Short Format:Short Format: Starting withStarting with ­ ­ CombinableCombinable
  • 13. Option ExampleOption Example ● Find the difference:Find the difference: ls ­a ­l lls ­a ­l l ls ­al lls ­al l ls ­allls ­all ls ­­allls ­­all ls ­­ ­­allls ­­ ­­all
  • 14. A Simple Command:A Simple Command: echoecho ● Function:Function: To display all arguments to STDOUT(screen),To display all arguments to STDOUT(screen), plus an endingplus an ending <newline><newline> character.character.
  • 15. A Simple Command:A Simple Command: echoecho ● Major options:Major options: ­n ­n : disable the trailing: disable the trailing <newline><newline> ­e ­e : enable interpretation of escapes (: enable interpretation of escapes ())
  • 16. Escaped Characters inEscaped Characters in echoecho ● Most Frequently Used:Most Frequently Used: backslash backslash b backspaceb backspace c produce no further outputc produce no further output n new linen new line r carriage returnr carriage return t horizontal tabt horizontal tab v vertical tabv vertical tab 0NNN byte with octal value0NNN byte with octal value xHH byte with hexadecimal valuexHH byte with hexadecimal value
  • 17. Examples ofExamples of echoecho ● UsingUsing ­n­n option:option: $ echo first line $ echo first line  first line first line  $ echo ­n first line $ echo ­n first line  first line $first line $  
  • 18. Examples ofExamples of echoecho ● Using escape character:Using escape character: $ echo ­e "atbtcndtetf" $ echo ­e "atbtcndtetf"  a       b       c a       b       c  d       e       f d       e       f   
  • 19. Examples ofExamples of echoecho ● Using escape with octal value:Using escape with octal value: $ echo ­e $ echo ­e  "141011142011143012144011145"141011142011143012144011145 011146" 011146"  a       b       c a       b       c  d       e       f  d       e       f    
  • 20. Examples ofExamples of echoecho ● Using escape with hex value:Using escape with hex value: $ echo ­e $ echo ­e  "x61x09x62x09x63x0ax64x09x65"x61x09x62x09x63x0ax64x09x65 x09x66" x09x66"  a       b       c a       b       c  d       e       f   d       e       f     
  • 21. Character Type in Command LineCharacter Type in Command Line ● Literal Character:Literal Character: Plain text, no functionPlain text, no function 123456 abcdefg …123456 abcdefg … ● Meta Character:Meta Character: Reserved with functionsReserved with functions
  • 22. Frequently Used Meta CharactersFrequently Used Meta Characters = =  :: set variable valueset variable value $ $  :: variable substitutionvariable substitution > >  :: redirect to STDOUTredirect to STDOUT < <  :: redirect from STDINredirect from STDIN | |  :: pipe linepipe line & &  :: background runningbackground running ()() :: run commands in nested sub-shellrun commands in nested sub-shell {}{} :: command groupingcommand grouping ; ;  :: run commands in frequencyrun commands in frequency &&&& :: run command while TRUErun command while TRUE |||| :: run command while FALSErun command while FALSE !! :: re-run command in historyre-run command in history
  • 23. Quoting UsageQuoting Usage ● Purpose:Purpose: Disable the functions of Meta Characters.Disable the functions of Meta Characters.
  • 24. Quoting MethodQuoting Method ● Escaping (Escaping ( ):): Disable meta character following backwardDisable meta character following backward slash by each.slash by each. ● Example:Example: $$ (( <newline><newline>
  • 25. Quoting MethodQuoting Method ● Hard Quoting (Hard Quoting ( '''' ):): Disable all meta characters within singleDisable all meta characters within single quotes.quotes. ● Example:Example: '...$...(...)...''...$...(...)...'
  • 26. Quoting MethodQuoting Method ● Soft Quoting (Soft Quoting ( ”””” ):): Disable some meta characters within doubleDisable some meta characters within double quotes.quotes. ● Example:Example: ““...$...(...)......$...(...)...““
  • 27. Exception in Soft QuotingException in Soft Quoting ● Reserved functions:Reserved functions: $ $ : substitute: substitute   : escape: escape ` ` : command substitute: command substitute !!  : history: history
  • 28. Quoting ExampleQuoting Example ● DisableDisable <IFS><IFS>:: $ A=B C$ A=B C # white space # white space  C: command not found.C: command not found. $ echo $A$ echo $A $ A="B C"$ A="B C" $ echo $A$ echo $A B C B C 
  • 29. Quoting ExampleQuoting Example ● DisableDisable <CR><CR>:: $ A='B $ A='B  > C> C > '> ' $ echo "$A"$ echo "$A" BB C C   
  • 30. Quoting ExampleQuoting Example ● Think about:Think about: $ echo "$A"$ echo "$A" BB C C    $ echo $A$ echo $A B CB C  
  • 31. Quoting ExampleQuoting Example ● Think about:Think about: $ A=B C$ A=B C $ echo '”$A”'$ echo '”$A”' ””$A”$A” $ echo “'$A'“$ echo “'$A'“ 'B C''B C'