Neat shell tricks
First, I really enjoyed Andy Libby’s post about some of his favorite command line tricks. Great stuff!
It also got me hunting for some new tricks. Here’s what I’ve found so far:
- Substitution with ‘^’
$ /etc/init.d/httpd stop $ ^stop^start #executes /etc/init.d/httpd start - Using CDPATH to get at common directories
$ export CDPATH="/usr" $ cd bin # goes to /usr/bin regardless of pwd