File Management related commands

Source: Internet
Author: User

1. CP

Copying files

How to use CP source destination

-R or-R: Recursive replication

–p Preserve original attributes (timestamp, genus, etc.) while copying

–L Copy a link to a file

–P Copy the linked file itself instead of copying the pointing file

–d Copy the link file itself, not to trace the file that the source link file points to

–a Archive replication, commonly used for backup equivalent to -dr plus --preference=all

--preferenc=all: Preserve file metadata properties while copying

–L Copy is the link to the file, and -P opposite

–i If the destination file exists, you are prompted to overwrite

Several rules:

(1). SRC is a file and if the destination file does not exist, a new dest is created and the SRC content is populated into the dest

(2). SRC is a file, if the target file exists, it will be overwritten with SRC content in the Dest file, it is recommended to use the-I option for the CP command, before overwriting will remind the user whether to overwrite

(3). SRC is a file, and if the target file is a directory, a new file with the same name as the source file is created directly under Dest and the SRC content is filled in

(4). SRC is multiple files, the dest must exist, and the directory

(5). SRC is a directory, you need to use the-r option for recursive replication, if the dest does not exist, then create the Dest directory, if the dest is a directory, copy the past directly, if Dest is a file, then the error

2.MV command:

Move files or rename

The MV does not have the-r option, so when the SRC time directory does not require the option to move directly

-I: Whether interactive reminders overwrite

3.RM command:

-I interactive reminder whether to overwrite

-F Force Delete

-R Recursive Delete, used to delete directories

This article is from the "After Tomorrow" blog, please be sure to keep this source http://leeyan.blog.51cto.com/8379003/1685772

File Management related 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.