change profile to show current directory
What do I need to add to my .profile file so that the user logged in will show his current absolute path?
Thanks, Jason |
Edit your .bashrc to look like this:
# User specific aliases and functions Code:
# Source global definitions |
Quote:
If so, then you want to modify the PS1 environment variable. From a command line, execute these statements: Code:
echo $PS1 jpolachak@hostname:/current/directory$ "\u" is replaced by the user name "\h" is replaced by the host's name "\w" is replace by your current directory (with a ~ representing your home directory) "\$" is replaced with a $ if you're a normal user or a # if you're the super user You can do lots of customization. Type man bash and search for the PROMPTING heading (hit the forwad slash ( / ) and type PROMPTING; hit "n" until you find the proper section heading). It will list the backslash codes and what they translate to. If you find something you like, make the change permanent by putting your PS1 assignment into your ~/.bash_profile. If you don't see a line that gives a value to PS1 in that file, then just add the export command above to the end of the file. Just substitute your customized sequence instead of what I used. |
All times are GMT -5. The time now is 09:56 AM. |