> cd <========== # Change to home dir
> pushd /bin <== # Change dir to /bin and add /bin to dir stack
/bin ~
> pushd /tmp <== # Change dir to /tmp and add /tmp to dir stack
/tmp /bin ~
> dirs <======== # Display current dir stack
/tmp /bin ~
> dirs -l <===== # Display in expanded (long) format
/tmp /bin /u/erinf
> dirs -v <===== # Display in verbose format
0 /tmp
1 /bin
2 ~
> popd <======== # Change dir back to /bin and remove /tmp from dir stack
/bin ~
>pwd
/bin
Note: dir=directory
If more than one of -n or -v is given, -v takes precedence.
Login shells do the equivalent of dirs -L on startup and, if savedirs is set, you should issue dirs -S before exiting. Because only ~/.tcshrc is normally sourced before ~/.cshdirs, dirsfile should be set in ~/.tcshrc instead of ~/.login.
tcsh