Command Prompt
CSC 105 The Digital Age Spring 2009
Currently, as your Terminal window awaits a prompt, most likely says only the machine name and a dollar sign, e.g.
  shockley$ 
It can be very handy to know which directory the shell is presently in while you are issuing commands (like copying files, creating directories, listing files, etc.). You may follow these steps to include the shell's "current working directory" in your shell prompt.
  1. Open a new terminal window.
  2. Open up a configuration file for your shell using an intuitive, graphical text editor with the following shell command:
    gedit ~/.bashrc
    (Don't forget to press enter after typing the command)
  3. This should give you a file that already has some things in it (you probably should see Mr. John David Stone's name somewhere). If not, then you may not have typed the previous command exactly as given above. Double check to be sure. There is no harm in closing gedit and trying again.
  4. Scroll down to the lines that read:
    # Set the prompt to machine name, dollar sign, space.
    
    PS1="\h$ "
    
  5. Edit this section so that it reads instead:
    # Set the prompt to machine name:working directory, dollar sign, space.
    
    PS1="\h:\W\$ "
    
  6. Save the file.
  7. The next time you log into MathLAN (or even start a new Terminal), your changes should take effect.