There 5 methods in using ‘cd’:
-
cd /path/directory move to a ‘/path/directory’
-
cd directory move to a ‘/directory’
-
cd – go back
-
cd .. go up 1 level
-
cd back to /home directory
Now, let’s practice.
I’ll show you some examples. My position is at /home/taufanlubis.
method # 1
taufanlubis@zyrex:~$ cd /usr
taufanlubis@zyrex:/usr$ ls -l
total 180
drwxr-xr-x 2 root root 53248 2007-08-12 12:45 bin
drwxr-xr-x 3 root root 4096 2007-08-11 07:32 etc
drwxr-xr-x 2 root root 4096 2007-04-15 18:52 games
drwxr-xr-x 35 root root 4096 2007-08-05 05:29 include
drwxr-xr-x 175 root root 69632 2007-08-12 11:04 lib
drwxr-xr-x 3 root root 4096 2007-08-01 06:58 lib64
drwxr-xr-x 10 root root 4096 2007-04-15 18:48 local
drwxr-xr-x 2 root root 12288 2007-08-13 13:57 sbin
drwxr-xr-x 323 root root 12288 2007-08-12 12:45 share
drwxrwsr-x 11 root src 4096 2007-08-16 07:26 src
drwxr-xr-x 3 root root 4096 2007-04-15 18:50 X11R6
taufanlubis@zyrex:/usr$
method # 2 (go to directory inside /usr, you don’t have to use /games)
taufanlubis@zyrex:/usr$ cd games
taufanlubis@zyrex:/usr/games$
method # 5 (go to home directory)
taufanlubis@zyrex:/usr/games$ cd
taufanlubis@zyrex:~$
method # 3 (go to the previous directory)
taufanlubis@zyrex:~$ cd –
/usr/games
taufanlubis@zyrex:/usr/games$
method # 4 (go up 1 level)
taufanlubis@zyrex:/usr/games$ cd ..
taufanlubis@zyrex:/usr$
Leave a Reply