Previous Table of Contents Next

Module 36
dirs (csh)


The internal dirs command displays the directory stack created by the pushd command. The dirs command does not manipulate the directory stack. It only displays the contents. You will find it useful if you use the pushd and popd commands.


The format of the dirs command follows.



Most users of the csh alias the pushd, popd, and dirs commands. For example, you might want to add the following lines to your .cshrc file.

    alias u pushd  # use u instead of pushd
    alias o popd   # use o instead of popd
    alias d dirs   # use d instead of dirs

Some sites implement the pushd, popd, and dirs command for the ksh. Ask your system administrator, if you use ksh, if the commands are available.


Refer to the popd and pushd commands described in modules 104 and 110.


The dirs command is simply used to display the directory stack without manipulating it. The directory stack contains a list of directories you can move between by using the pushd or popd commands.


In this activity you use the dirs command to display the directory stack. Begin at the shell prompt.

1.  Type dirs and press Return. Notice the directory stack created with the pushd command is displayed.
       cj> dirs
       ~ /usr/spool/uucppublic /usr/lib
2.  Turn to Module 8 to continue the learning sequence.

Previous Table of Contents Next