How do you change your prompt variable to display the current working directory (pwd), meaning so that when a directory is changed the prompt also changes to reflect the current directory you are in
How do you change your prompt variable to display the current working directory (pwd), meaning so that when a directory is changed the prompt also changes to reflect the current directory you are in
I'm pretty certain the default prompt already does that, but here it is, for reference:
The important bit is the
\w
part. You can set it to\W
for only the name of the current directory (basename $(pwd)
).Check out the full list at TLDP.