commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
this command will add the following two lines into the ~/.bash_aliases:
alias exit='pwd > ~/.lastdir;exit'
[ -n "$(cat .lastdir 2>/dev/null)" ] && cd "$(cat .lastdir)"
or redirect it to the ~/.bashrc if you like
Donno, I find it usefull. You may also define an alias for 'cd ~' like - alias cdh='cd ~'
There are 8 alternatives - vote for the best!
If you can do better, submit your command here.
You must be signed in to comment.