Professional Documents
Culture Documents
Davidsouther - Bash ZSH Shourtcuts PDF
Davidsouther - Bash ZSH Shourtcuts PDF
Sed commands
Tab
${parameter}
Value of
:[label]
parameter
End of line
${parameter:-word}
Use default
${parameter:=word}
Assign default
a\
Append text
${parameter:?word}
Display Error
text
(embedded newlines)
${parameter:+word}
Use Alternate
${parameter:offset}
Substring
b [label]
Jump to label
%b
${parameter:offset:length}
t (T) [label]
^w
${!name[@]}
c\
Replace match
${#parameter}
Parameter length
text
(Embedded newlines)
${parameter#match}
Remove prefix
d (D)
${parameter##match}
(longest)
hH
Copy/Append pattern
${parameter%match}
Remove suffix
gG
Paste/Append hold
${parameter%%match}
(longest)
Exchange hold/pattern
^p
${parameter/pattern/strin
Substitution
nN
^n
Print pattern
^r
s/regex/replace/
Substitution
^l
Clear screen
^o
^z
Suspend process
fg
restore process
bg
^a
^e
^f
^b
^h
%f
^u
^k
^y
^t
%t
Auto complete
Beginning of line
g}
${parameter^pattern}
Uppercase match
${parameter^^pattern}
Uppercase all
${parameter,pattern}
Lowercase match
${parameter,,pattern}
Lowercase all
Set label
Addresses
first~step
/regex/
addr1,+N
^c
Various
^d
Exit shell
{c1;c2;c3;}
List of commands
Separate commands
Rockstar Penguin
By DavidSouther
Sponsored by Readability-Score.com
cheatography.com/davidsouther/
Page 1 of 1.
https://readability-score.com