> 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
-n と -v の両方が指定された場合には、-v が優先されます。
ログイン・シェルは、始動時に dirs -L と同等のことを行います。savedirs が設定されている場合、ユーザーは終了前 に dirs -S を出す必要があります。 通常は、 ~/.cshdirs の前 に ~/.tcshrc だけが検索されるので、dirsfile は ~/.login で はなく ~/.tcshrc の中に設定する必要があります。
tcsh