Thursday, August 30, 2007

Unix - change working directory

`cd` - change working directory.

The cd utility will change the working directory of the current shell execution environment. When invoked with no operands, and the HOME environment variable is set to a non-empty value, the directory named in the HOME environment variable will become the new working directory.

EXAMPLE:

[root@server log]# pwd
/var/log
[root@server log]# cd ..
[root@server var]# pwd
/var
[root@server var]# cd /var/mail
[root@server mail]# pwd
/var/mail
[root@server mail]# cd /
[root@server /]# pwd
/
[root@server /]# cd
[root@server root]# pwd
/root

No comments: