Bash - Cd (Change Directory) builtin command

Bash Liste Des Attaques Ovh


File - Change Directory (cd) in bash. Cd is a builtin command that changes the current directory


cd [-L|-P] [dir|-]


If a directory change is successful through cdpath or -, the absolute pathname of the new working directory is written to the standard output.

The return value is true if the directory was successfully changed; false otherwise.

Environment variable


The variable HOME is the default dir.


The variable CDPATH defines the search path for the directory containing dir.

Alternative directory names in CDPATH are separated by a colon (:).

A null directory name in CDPATH is the same as the current directory, i.e., ..

If dir begins with a slash (/), then CDPATH is not used.

A colon-separated list of search paths available to the cd command, similar in function to the PATH variable for binaries. The CDPATH variable may be set in the local ~/.bashrc file.

bash$ cd bash-doc
bash: cd: bash-doc: No such file or directory

bash$ CDPATH=/usr/share/doc
bash$ cd bash-doc

bash$ echo $PWD

Documentation / Reference

Discover More
Bash Liste Des Attaques Ovh
Bash - (Builtin|Intern|System|Reserved|Shell) variable name

Reserved variable name are named that have a special meaning for the bash shell. PS1 defines the shell's command-line prompt. HOME defines the home directory for a user. PATH defines a list...
Bash Liste Des Attaques Ovh
Bash - Builtin Commands

builtin refers to: a builtin command. See or to the specific builtin command. See (useful when defining a function whose name is the same as a shell builtin) The builtin command execute the specified...
Bash Liste Des Attaques Ovh
Bash - popd (Builtin command)

popd removes entries from the directory stack. See dirs. With no arguments, removes the top directory from the stack, and performs a cd to the new top directory. where: +n - Removes the nth...
Undraw File Manager Re Ms29
File - Change Directory (cd)

Cd is a function or utility that changes the current directory (working directory). bash dos This function implements the resolve function with the first argument being the absolute...
Bash Liste Des Attaques Ovh
Bash - (Current|Working) Directory

This article is the management of the current directory in Bash. You can query the current working directory via: the pwd utility or via the PWD environment variable shell variable concerning...
Bash Liste Des Attaques Ovh
What is pushd (Push Directory) in Bash?

Adds a directory to the top of the directory stack, or rotates the stack, making the new top of the stack the current working directory. dirs With no arguments, exchanges the top two directories...

Share this page:
Follow us:
Task Runner