Linux Command Learning (1): commands for copying (CP), deleting (RM), and moving (MV) files

Source: Internet
Author: User
CP to copy the source files and directories. The general format is as follows:

CP [Option] source file or directory target file or directory.

Option description:
-A: used to copy a directory. recursively copy all the files and subdirectories in the directory to the target location to retain the file links and attributes. Use-DPR
-R: Copy files and subdirectories in the directory
-F: if a file with the same name already exists, it is overwritten and no prompt is given.
-I: In contrast to-F, a prompt is displayed when the file is overwritten for the user to select.

You can use CP -- help to view other options.

RM: delete a file (a directory is also a file) in the following format:

Rm [Option] File List

Option description:
-F: ignore non-existing files and do not prompt
-I: Interactive Deletion
-R: recursive Deletion

MV, rename a file or directory (if the file name is the same as the target path, it means renaming), or move it. The format is as follows:

MV [Option] Source Target

Option description:
-I: indicates an interactive operation. A prompt is displayed for risky operations.
-F: non-interactive operation.

========================================================== ==========
I believe you can see that-I is an interactive operation, while-F is a non-interactive operation.

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.