How to change the command line prompt for your xterm

Many users find it convenient to have the current directory displayed in the command prompt. It is a simple configuration change to make this change permanent.

To set your prompt:

  1. Use your favorite editor to open your [local] copy of the file named, ~/.cshrc.local


  2. Find and uncomment the following line to get a prompt that shows the machine name and the command counter. To uncomment a line, just delete the # character at the start of the line. To comment out a line, just add the # character at the start of the line or comment.
  3.       set prompt = "${HOSTNAME}(\!)% "
    
  4. Or leave the above line commented (for future reference) and add this line to the file. This prompt will show the current working directory
  5.       set prompt = "${HOSTNAME}\[%~\]% "
    
  6. To get the machine name, current working directory and the command counter:
  7.       set prompt = "${HOSTNAME}\[%~\](\!)% "
    

There are many other configuration options available to you within the ~/.cshrc.local file. But do not edit carelessly. You may not be able to login if you "break" this file by introducing a syntax or other more serious error while modifying your shell configuration.