Linux CD command

Source: Internet
Author: User

The CD command is used to switch the working directory to dirname. Where dirname notation can be either an absolute path or a relative path. If the directory name is omitted, it is transformed to the user's home directory (that is, the directory where login was first).

In addition, the ~ is also expressed as the meaning of home directory, which is the current directory. Represents the previous level of directory at the current directory location.

Grammar

CD (options) (parameters)

Options

-P If the destination directory that you want to switch to is a symbolic connection, switch directly to the destination directory where the symbolic connection is directed to-L if the destination directory that you want to switch to is a symbolic connection, switch directly to the directory that the character connection name represents, not the destination directory that the symbolic connection points to.

-When only the "-" option is applied, the current working directory is switched to the directory represented by the environment variable "OLDPWD".

Instance

The CD enters the user's home directory;

CD ~ Enter the user's home directory;

CD-Returns the directory where the directory was before it entered;

Cd.. Return to the parent directory (if the current directory is "/", then "/"; "..." after execution) The meaning of the parent directory);

Cd.. /.. Return to the top level two directory;

CD!$ Use the parameters of the previous command as CD parameters.


Linux CD command

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.