Created
November 22, 2011 23:24
-
-
Save eegrok/1387400 to your computer and use it in GitHub Desktop.
uncommon linux / bash commands worth using
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| you can pipe stuff through ssh -- e.g., concatenate your SSH key on another host. | |
| cat ~/.ssh/id_dsa.pub | ssh me@remotebox "cat >> ~/.ssh/authorized_keys" | |
| lsof - http://danielmiessler.com/study/lsof/ | |
| disown (detach from process so when close your terminal it doesn't get killed -- like doing nohup in advance) | |
| xargs / parallel | |
| sudo !! -- repeat last command with sudo prepended | |
| !$ -- last argument to last command | |
| !* -- all arguments to last command | |
| !:s/foo/bar -- redo last command replacing first instance of foo with bar | |
| !:gs/foo/bar -- redo last command replacing all instances of foo with bar | |
| nc -- network communications stuff -- can do things like this: | |
| on box1: tail -f sslerror.log | nc -l 9999 | |
| on box2: nc box1url 9999 | |
| and on box2 you'll get a stream of the error log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment