Pete Freitag Pete Freitag

More bashing


Thanks to my brother Steve, I was able to get my backtracking cd to the way I wanted it to

Just add the following to your ~/.bashrc or if you want to make this work system wide add this to /etc/bashrc:

#redefine pushd and popd so they don't output the directory stack
    builtin pushd "$@" > /dev/null
    builtin popd "$@" > /dev/null

#alias cd so it uses the directory stack
alias cd='pushd'
#aliad cdb as a command that goes one directory back in the stack
alias cdb'popd'

The redefinition of pushd and popd redirects their output to /dev/null instaed of your terminal. This prevents them from displaying the entire stack every time they are called

Like this? Follow me ↯

More bashing was first published on April 03, 2003.

Want Security Advisories via Email?

Advisory Week is a new weekly email containing security advisories published by major software vendors (Adobe, Apple, Microsoft, etc).