Next: Remotely shutting down your
Up: Working with the shell
Previous: Customizing your shell
Would you like to know what directory you're in without using pwd?
- You can have your prompt reflect your current directory.
- If you use tcsh, download the file shortpath.awk
to your home directory (or another directory and make the appropriate changes in the command below)
and insert the following in your .cshrc file in your home
directory.
set base="`basename $HOST .biostat.harvard.edu`"
# obviously, change .biostat.harvard.edu to reflect your domain
set histbang=! alias cd 'cd \!*; set prompt="[$histbang]${base}:`pwd
| awk -F/ -f $HOME/shortpath.awk`>"'
- If you use bash, insert the following in your .bashrc file
in your home directory.
export PS1="your_user_id@\h:\w>
"
Chris Paciorek
2006-04-02