1.查询进程
vi ~/.bashrc
p() { ps auxw|egrep "$1|PID"|grep -v egrep;}
$ p mysql
2.加速cd
export CDPATH=.:..:~:/root/workspace
3.
$ 'ALT+.' or ' .'
Place the argument of the most recent command on the shell
4.
$ time read (ctrl+d to stop)
A very simple and useful stopwatch
5.查看ASCII表
$ man ascii
Quick access to the ascii table
6.
$ (cd /tmp && ls)
Jump to a directory, execute a command and jump back to the current dir.
7.
$ sudo !!
Run the last command as root.
8.
$ :w !sudo tee %
Save a file you edited in vim without the needed permissions.
9.
$ ^foo^bar
Run previous command but replacing
10.
$ python -m SimpleHTTPServer
Serve current directory tree at
11.
$ cp filename{,.bak}
quickly backup or copy a file with a bash
12.
$ !whatever:p
Check command history, but avoid running it.
13.
$ e
Rapidly invoke an editor to write a long, complex, or tricky command.
14.
$ >file.txt
Empty a file.
15.
$ !!:gs/foo/bar
Runs previous command replacing foo by bar every time that foo appears.
16.
ssh-copy-id user@host
Copy ssh keys to user@host to enable password less login.