Is there a way to get my ubuntu command prompt to be something like:
user@host:home$
but still have the behavior of:
user@host:home$ cd projects
user@host:home/projects$
Right now, my working directory path before the home directory is cluttered with stuff from my school's servers (e.g. user@host:/blah/blah/blah/home$ ). Is there a way I can still append the directory path to the prompt as I navigate around, but just trim the beginning stuff off?
You can create a function and place it in your rc file (perhaps ~/.bashrc) like this:
Also add this command to enable expansion in prompt:
Then set your PS1 prompt to something like this: