1

I edited my .bashrc to add more directories to $CDPATH. It looks like this:

export CDPATH=".:~:~/LEI/2_ano/2_smt:~/LEI/2_ano/1_smt"

But now every time I use the cd command, it prints the absolute path. For example, if I do cd ~/Downloads, the result is

/home/user_name/Downloads
User_prompt:~/Downloads$ 
muru
  • 207,228

1 Answers1

1

I don't think you can stop it from printing, since that's the documented behavior:

If a non-empty directory name from CDPATH is used, or if ‘-’ is the first argument, and the directory change is successful, the absolute pathname of the new working directory is written to the standard output.

However you could overload cd with a shell function that redirects standard output:

cd ()
{
    command cd "$@" > /dev/null
}
muru
  • 207,228
steeldriver
  • 142,475