Common commands for Linux folders-delete non-empty files-copy-Rename

Source: Internet
Author: User
Common commands for folders in Linux-delete non-empty-copy-Rename-general Linux technology-Linux technology and application information. For more information, see the following. Generally, the rm file name is used to delete a file.

To delete a folder, use the rmdir folder name.

But rmdir cannot delete non-empty folders. How to delete non-empty folders:

Command: rm-rf non-empty folder name

We recommend that you back up the file before using it. It seems that this command will not be placed in the recycle bin, and you will never see the following files again after you delete it.

Copy a folder
CP command
Format: CP [Option] source file or directory target file or directory
Option Description:-B with the same name.
-F forcibly overwrite files with the same name
-R: retained the original directory structure to copy files recursively.

Cp-r/tmp/a/root/

Rename a folder
Mv oldfilename newfilename
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.