Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

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
share|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
3  
@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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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