Linux Learning Directory processing commands

Source: Internet
Author: User
Tags create directory

1. Display the files in the directory LS

The option-a represents English all, and the hidden file is displayed.

Option-L for English long, showing file or directory details

The option-H denotes an English human, which is a humanized display, primarily used to display the size of a file or directory in a suitable unit.

Option-I represents an English ID that displays the ID of the file or directory.


2. Create directory MkDir

Option-P represents the English loop, which is a recursive creation of directories from top to bottom, regardless of whether the above directory exists.

You can create multiple subdirectories at the same time under one directory, such as mkdir Jpan/boduo japan/cangjing Japan/longze


3. Switch Directory CD

.. Represents the previous level of the directory

. Represents the current directory

CD-Indicates that the last directory was returned. Note that it was the last time, not the last level.


4. Display the current directory pwd


5. Delete directory RmDir

Only empty directories can be deleted, that is, directories cannot contain subdirectories or files.


6. Copy files or directories CP

If you are copying a directory, you need to add the option-R

You can copy multiple files or directories to the same target directory at the same time, such as CP Jpan/boduo japan/cangjing japan/longze/tmp

The option-P represents the property, which means that the original properties of the file or directory are preserved when copying, such as when the file was changed.

Replication can also set the name of the file or directory after it is copied, such as copying the directory Cp-r jpan/boduo/tmp/newname then the copied directory name is newname


7. Cut files or directories MV

You can cut multiple files or directories to the same target directory at the same time, such as MV Jpan/boduo japan/cangjing japan/longze/tmp

Cut can also set the file or directory after the cut name, such as cutting directory MV Jpan/boduo/tmp/newname then the cut directory name is NewName

Cut in the same directory, that is renamed, such as MV Oldname newname


8. Delete file rm

If you are deleting a directory, you need to add the option-R

The option-F represents force, which indicates a forced deletion and does not ask before it is deleted.

RM-RF * indicates that all files and directories under the current directory are deleted.


Linux Learning Directory processing 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.