Yanuar Aditya bio photo

Yanuar Aditya

Dota & Volvo Cars

Email Twitter LinkedIn Instagram Github Steam

Do you wonder how to hide your current working directory in terminal? If you’re in ~/Workspace/firstDir/secondDir/thirdDir, then it would show terminal as something like this:

januaditya@janu-rmbp:~/Workspace/firstDir/secondDir/thirdDir$

If you want the shell to show just the last directory, which in this case is thirdDir, you can add this to ~/.bash_profile:

export PS1="\W \$"

Then, source the bash using:

$ source ~/.bash_profile

Now, your terminal would look like this:

thirdDir $

Look what you can do more on command prompt (UNIX/Linux).