Chapter 14. Keeping Track of Where You Are

In This chapter:

  • Types of Location Reporting

  • Displaying Your Location in the Prompt

  • Display Your Location in the Window Title

  • Putting It All Together

  • Displaying Other Types of Information

When you’re actively working in a directory, you can usually remember your current location. However:

  • It’s easy to forget where you are when you’re interrupted by a phone call, take a coffee break, or pause to discuss a project with a coworker.

  • When you work in a multiple-window environment that allows you to maintain several simultaneous shell sessions, it can be difficult to remember which directory window is current.

  • If you have accounts on multiple systems, remembering your location becomes more complicated because you must also consider the machine you’re logged in on.

One way to determine your location is to use the command line. pwd (“print working directory”) shows the name of your current directory, dirs prints the directory stack, and, on most machines, either hostname, uname –n, or who am i will show the name of the machine you’re logged into. However, there are better ways to get feedback on your location. This chapter discusses how to set up your ˜/.cshrc file to have the shell provide that information automatically, so you don’t have to waste time running commands to figure out where you are.

Types of Location Reporting

One method of getting location information is to have the shell announce directory changes when you use cd, pushd, or popd. pushd and ...

Get Using csh & tcsh now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.