Linux Commands--CD

Source: Internet
Author: User

CD [-l|-p] [dir]

Change the current directory to dir.  the variable HOME is the default dir.  the variable Cdpath defines the sea RCH path for  the  directory containing dir.  alternative directory names in Cdpath is separated by a Colo N (:).  a null directory name in Cdpath are the same as the current directory, i.e., ".".  if dir begins with A Slash (/), then Cdpath was not used. The-p option  says  to  use  the  physical directory  structure  instead  of Foll Owing symbolic links (see also the-p option to the set BUILTIN command); The-l option forces symbolic links to be followed.  an argument of-is equivalent to $OLDPWD.  if a non-empty directory name from Cdpath is used, or  if  - is the first argument, and the director Y change was successful, 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.


Home: Default login home directory echo $HOME

Cdpath: Used to conveniently switch common directories, for example:export Cdpath=.:~:/etc:/var. Permanent Save: Vim ~./bash_profile

oldpwd: stores the location of the last directory switch.

CD: user home directory, synonymous with $home.

CD ~: With the owner's directory, synonymous with $home.

CD-P: Physical directly switches the physical directory.

Cd-l: Link, logic switches to the symbolic connected directory and does not point to the physical directory.

CD-: Synonymous with $oldpwd, pointing to the last directory.

Cd. : Current directory

Cd.. : The parent directory of the current directory


Linux Commands--CD

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.