CD of Linux commands

Source: Internet
Author: User
Tags parent directory

CD [-l |-p] [directory]

Switch directories

(1). Options

-L If the destination directory you want to switch to is a symbolic connection, switch directly to the destination directory to which the symbolic connection is directed

-P If the destination directory to be toggled is a symbolic connection, switch directly to the directory that the character connection name represents, not the destination directory to which the symbolic connection points

There are also some special symbols

. Current directory

.. Parent Directory

-Previous working directory

~ User home directory, which is the directory specified by the home variable, such as the root user's home directory is/root

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

(2). Example

[[Email protected] Desktop]# pwd//view current directory/root/desktop [[email protected] Desktop]# cd/home//absolute path [[email protected] home]# pwd/home[[e Mail protected] home]# CD//no parameters, default go to home variable specified directory, approximately equal to ~[[email protected] ~]# Pwd/root[[email protected] ~]# CD-//back to previous directory /home[[email protected] home]# Pwd/home[[email protected] home]# CD!$//Repeat last parameter CD-/root[[email protected] ~]# pwd/root[   [Email protected] ~]# CD. Return to parent directory [[email protected]/]# Pwd/[[email protected]/]# CD./var/spool/mail///relative path [[email protected] mail]# PWD/VAR/SP Ool/mail

  

CD of Linux commands

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.