$CDPATH is also amusing:
$ mkdir /foo/bar/baz
$ cd baz
bash: cd: baz: no such file or directory
$ export CDPATH="/foo/bar"
$ cd baz
$ pwd
/foo/bar/baz11–20 of 107 posts
$CDPATH is also amusing:
$ mkdir /foo/bar/baz
$ cd baz
bash: cd: baz: no such file or directory
$ export CDPATH="/foo/bar"
$ cd baz
$ pwd
/foo/bar/bazsudo !! (Run the last command as root)
:w !sudo tee % (Save a readonly file in VIM)
> tmp.file (Empty a file)
cmd !$ (Run cmd with previous commands arguments)
They are just some of my favorites.
set -o vi # vi like behaviour of the command line. Use "/" to search through the history, "y" to copy, "p" to paste etc.. cat > somefile.txt Type EOF in a new line to finish.
http://www.commandlinefu.com
set -o vi # vi like behaviour of the command line. Use "/" to search through the history, "y" to copy, "p" to paste etc.. cat > somefile.txt Type EOF in a new line to finish.
Or just omit the <<EOF and press Control-D to finish (assuming you have not done anything strange with stty).
> make me a sandwich
what? make it yourself
> sudo !!
okayIt's a great kill-ur unix tip but you should never fall for it: :(){ :|:& }; Oh, the temptation... if you're thinking of cutting & pasting that into the shell of your machine google for 'bash fork bomb' first, I've left off the final ':' to set it off. Anyway, on a more serious note, after an installation procedure that was a lot of work, if you want to document the whole thing use: history | cut -d ' ' -f 5- To give…