Cd (command)

Cd, on some platforms also chdir ( for change directory), is a command line command for use in shells, which allows a change of the working directory. He comes under virtually all major operating systems, including Unix, DOS, OS / 2, AmigaOS, Windows, and Linux. On UNIX version 5 and earlier only the command chdir is known. The short name of cd was introduced after the advent of 110 baud modems to increase the operating speed.

Function

In most operating systems, the concept of the working directory will be used. The working directory to check out the current position in the directory hierarchy dar. With the cd command this working directory can be changed, the user enters as a parameter to cd to the target directory that the new working directory should be. This specification can be absolute ( starting from the root directory ) or relative happen to the current working directory.

POSIX

The corresponding system call to change the working directory is POSIX chdir (2). The POSIX standard is assumed to reflect the few parameters of the usual Unix and Linux implementations.

  • -L (csh -l ): Symbolic links to be maintained in the directory path
  • -P (csh :-p ): Symbolic links are resolved, the directory path is reflected after the call to cd so the actual directory tree resist
  • - (Instead of a target directory ): returns to the previous working directory

Most shells allow the user also (usually CDPATH ) to specify a list of directories in an environment variable. This list is then searched for matching subdirectories when cd is called with a relative path.

Without parameter changes cd to the home directory of the user who invoked the command cd .. it goes up one level. In some cases, additional parameters are added.

Relates the command chroot, to which another directory can be set as a temporary root directory.

DOS / Windows

Under DOS - based operating systems with their drive letter of the command changes only within a volume; for changing the drive itself, a further command is required. The other functionality is severely limited, since neither DOS user directories nor symbolic links knows. The links under Windows are at the DOS level files only.

Moreover cd .. cd .. to be cut, what does not work in the Recovery Console of Windows CD in Windows PowerShell, and many other operating systems.

171138
de