Linux Basic Command One

Source: Internet
Author: User

absolute path and relative path

Absolute path: The full path from/start to the file location. This path allows you to access the file, regardless of the directory you are currently in. (absolute paths are generally used in scripts to facilitate migration)

Relative path: Not from/start, which is the path starting from the current directory.


PWD: View the directory that is currently located.


CD command (change directory)

CD directory: Go to a directory.

CD-: Go back to the same directory you were in.


CD: Return to the home directory of the logged-in user.

CD ~: Ibid.


Cd.. : Go back to the top level directory. (If the command is hit/down, it will still stay in/down, because/is the top-level directory)

Cd. : Stays in the current directory.


mkdir command

mkdir directory: Create a new directory.

Mkdir-p Directory 1/directory 2: Recursively create directory (directory 1 does not exist, the actual process is to create directory 1 and then create directory 2)


MKDIR-PV Directory 1/directory 2: Recursively create directories and visualize them.


RmDir Empty directory: Delete an empty directory.


Touch files: Create a new file or update the timestamp of the file (you need to add the corresponding option).

Stat file: View the time properties of a file.


RM command (REMOVE)

RM file: Deletes a file. (You will be prompted to confirm the deletion before deleting)


Rm-f file: Forcibly delete a file (without prompting).


Rm-r directory: Deletes a directory. (Prompt to confirm deletion)

RM-RF Directory: Forces a directory to be deleted. (not prompted)


RM-RFV Directory: Forces a directory to be deleted. (visualization)


RM after adding the-f option, regardless of the file or directory to be deleted does not exist, will not error, you need to pay attention.



Linux Basic Command One

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.