Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
service
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
Freenet DSL
Who's Online
9 user(s) are online (7 user(s) are browsing encyclopedia)

Members: 0
Guests: 9

more...
partner

Chdir

The chdir or cd command (change directory) in the Unix and DOS operating systems, is used to change the current working directory. It is available for use at the command line as well as in a UNIX shell script or DOS batch command file. cd is frequently included built into certain UNIX shells such as the Bourne shell, Tcsh, and Bash.

A folder or directory is a logical section of a partition used to hold files. A directory is allowed to contain a directory. The CD command can be used to move down into a directory, move back into the parent directory, move all the way back to the root (/ in UNIX, in DOS) or move to any given directory name.

For example, in Unix:

ls workreports games encyclopedia text.txt cd games

The user is now in the games directory.

The same thing in DOS would look like this:

C:> dir workreports Wed Oct 9th 9:01 games Tue Oct 8th 14:32 encyclopedia Mon Oct 1st 10:05 text txt 1903 Thu Oct10th 12:43 C:> cd games C:games>

Note that cd has different effects on different operating systems if given with no arguments. For example, if executed without arguments in DOS, the current working directory is printed. If executed without arguments in UNIX, then the user is returned to the home directory. The effect of executing the cd command within a script or batch file also varies. In DOS, the caller s current directory can be directly altered by the batch file s use of this command. In UNIX the caller s current directory is not altered by the script s invocation of the cd command. This is because in UNIX, the script is usually executed within a subshell.


chdir() is also a POSIX C programming language function which changes the working directory.


CHDIR() is also a Visual Basic function which changes the working directory.