Learn a Linux command every DAY--DAY1:CD commands

Source: Internet
Author: User

Linux CD commands can be said to be the most basic Linux command statements, used to switch directories, is the shell's built-in commands, to do other things, are built on the use of CD commands.

Therefore, to learn the common Linux commands, the first step is to learn How to use the CD command skills.

Command format:

CD [-l|-p] [dir]

Command function:

-P If the destination directory you want to switch to is a symbolic connection, switch directly to the destination directory that the symbolic connection is pointing to.

-L If the destination directory that you want to switch 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".

Common examples:

 Cd/home/test into the/home/test directory

CD ZB execute the command above and go to the/HOME/TEST/ZB directory

Cd.. Return to the previous level directory, with CD. /

Cd. Current directory, do not switch

CD ~ Switch to the root directory of the current user: If the current user is ZB, go to the/ZB directory

CD-Returns the directory in which the directory was previously entered. such as ①CD/HOME②CD TEST/ZB③CD-at this time in the/home directory

CD/Enter system root directory

CD!$ Use the parameters of the previous command as CD parameters. such as EXAMPLE1:①CD. ②CD!$ equivalent to execute CD. EXAMPLE2:①PWD②CD!$ is equivalent to performing CD pwd at this time

Reference: http://www.cnblogs.com/peida/archive/2012/10/24/2736501.html

Learn a Linux command every DAY--DAY1:CD commands

Related Article

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.