ログイン直後のカレントディレクトリを確認(ホームディレクトリ)
[student@h006 ~]$ pwd
/home/student
カレント・ディレクトリをサブ・ディレクトリ public_html/Startup へ移動。
[student@h006 ~]$ cd public_html/Startup/
[student@h006 Startup]$ ls
Admin Programmers Tips index.html remarks.html work
Network Solaris Users index.html.eucjp rpm.log
さらにサブディレクトリ Users へ移動
[student@h006 Startup]$ cd Users/
[student@h006 Users]$ pwd
/home/student/public_html/Startup/Users
ひとつ上のディレクトリ(../)という表現を使って、となりの Programmers へ
[student@h006 Users]$ cd ../Programmers/
ホームディレクトリへ戻り
[student@h006 Programmers]$ cd
[student@h006 ~]$ pwd
/home/student
CDPATH で指定されたサブディレクトリへ直接移動
[student@h006 ~]$ CDPATH=~/public_html
[student@h006 ~]$ cd Startup
/home/student/public_html/Startup
なおCDPATHの内容に従って移動した場合は、cd 実行直後にディレクトリが表示される。