tools:bash:shortcuts-piping
This is an old revision of the document!
Table of Contents
This article is Part 2 in a series of cheat-sheets on the command line shell, bash. (Previous Page | Next Page)
bash: Keyboard Shortcuts and Piping Commands
Copy and Paste
- Ctrl+K (Cut text to end of line)
- Ctrl+U (Cut text to beginning of line)
- Ctrl+W (Cut word located behind cursor)
- Alt+D (Cut word following cursor)
- Ctrl+Y (Paste most recently cut text)
- Alt+Y (Rotate back to previously cut text and paste it)
Command Line Editing
Up Arrow(Previous Command)Alt+F(Word Forward)Alt+B(Word Backward)Ctrl+A(Beginning of Line)Ctrl+E(End of Line)Ctrl+L(Clear Screen)Alt+T(Transpose Words)Alt+U(Transform Uppercase)Alt+L(Transform Lowercase)Alt+C(Transform Capitalize)Ctrl+V(Insert Special Character)Ctrl+C(Delete entire line)
Command Completion
Recall last ten commands from history:
$ history 10
Execute command from history with value of xxx:
$ !xxx
Execute last command from history:
$ !!
Open historical command xxx in text editor:
$ fc xxx
Working With Multiple Commands At Once
Executes pwd followed by ls:
$ pwd ; ls
Executes commands in new child shell:
$ (pwd ; ls)
Sorts passwd and opens the results in less:
$ cat /etc/passwd | sort | less
Untars file in background:
$ tar -xvf file &
Expands variable TEST:
$ echo $TEST
Search for all files in /home containing test in filename and open them in vi:
$ vi $(find /home | grep test)
Example of arithmetic expression:
$ echo "$[2000 - 1500]"
Metacharacters
?(Matches any one character)* (Matches any number of characters)<(Directs contents of file to a command)>(Directs command output to a file)2>(Directs error from command to a file)&>(Directs command output and errors to a file)»(Directs output to file, appending it to the end of file)|(Pipes output of previous command to input of next command);(Sequentially executes next command)&(Runs command in background)$(For expanding variables, substitutions, and expressions)$( )(Command substitutions)$[ ](Arithmetic expressions)
- Next Page: Managing Processes →
tools/bash/shortcuts-piping.1727499705.txt.gz · Last modified: (external edit)
Find this page online at: https://bestpoint.institute/tools/bash/shortcuts-piping
Find this page online at: https://bestpoint.institute/tools/bash/shortcuts-piping