After calling pushd/popd in bash, it will print off the current directory stack. Is there any way to prevent this behaviour, so that it will act 'quitely'? This sort of noise in a command is uncommon in unix tools.

link|improve this question

79% accept rate
feedback

1 Answer

up vote 3 down vote accepted

I think this sort of "noise" is not uncommon, that's why you often do this:

pushd > /dev/null
link|improve this answer
You can also make a function to basically redefine the command and stick it in .bashrc such as: pushd() { builtin pushd $1 > /dev/null; } – jrod Feb 1 '10 at 2:02
1  
@jrod: Since pushd can takes multiple arguments, you might want that as pushd() { builtin pushd "$@" > /dev/null; } and the quotes handle directory names with spaces. – Dennis Williamson Feb 1 '10 at 2:52
Good tip, but most unix tools don't print to the terminal EVERY TIME, but only if there's an error – Rory Feb 1 '10 at 10:05
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.