Home » Misc » Some Linux Command …
Some Linux Command Line Tricks
Editing
This is a modified version based on http://www.linuxjournal.com/content/time-saving-tricks-command-line.
Ctrl-r
: reverse interactive search of command history.Ctrl-w
: cut text backward until space.Ctrl-l
: clear the command window.Esc-Backspace
: cut one word backward.Esc-Delete
: cut one word forward.Ctrl-k
: cut from current position until the end of the line.Ctrl-y
: paste the most recently cut text.Ctrl-a
: jump to the beginning of the line.Ctrl-e
: jump to the end of the line.Esc-b
: jump one word backward.Esc-f
: jump one word forward.
Funny Commands
tac
: print the content of a text file in reverse order, i.e., from last line to first line.
yes “some string”
: print a given string, till interrupt instruction is given.
shuf
: random selection from a bunch of lines.
<space> Command
: avoid the Command
to be recorded by history
.
Maybe useful
du -h –max-depth=1
: print the size of sub-folders within the current directory, in human readable format.
nl filename
: number the lines of a file.
curl ifconfig.me
: print the external IP address.
last
: show the history of last logged in users.