Linux Basic file Management commands

Source: Internet
Author: User

Linux basic File management commands

I.. C P  [OPTION] ... [-T]

1>. SOURCE DEST

CP [OPTION] ... SOURCE ... DIRECTORY

CP [OPTION] ...-t DIRECTORY SOURCE ...

2>. C P SRC DEST

2.1>SRC is a file

If the destination file does not exist: Create a new dest and src the contents of the content are filled into dest;

If the catalog file exist:

If Dest is a file, the contents of SRC are covered to dest:

The CP command is now recommended to use the-I option;

If Dest is a directory, create a new file with the same name as the original file under Dest, and populate the contents of SRC with the new file;

2.2> . src is the directory: Use this time option:-R

If Dest does not exist: creates the specified directory and copies all files in the SRC directory to dest;

If dest exists:

If Dest is a file: Error

If Dest is a directory:

3>. CP SRC ... DEST

SRC ... : Multiple Files

dest must exist and be directory , other situations will be error;

4> . Common options:

-I : interactive ;

-R ,-r: recursively copy directories and all internal content;

-a : archive, equivalent to-DR--preserv=all

- D :--no-dereference--preserv=links

--preserv[=attr_list]

mode: permissions

Ownership: belong to the main group

Timestamp: time stamp

links

xattr

context

all

-P :--preserv=mode,ownership,timestamp

-v :--verbose

-L : Create file link instead of copy file (LN)

-S : Creating Symbolic Links two not copying files (ln-s)

two. MV Command: Move, moving files

Common options:

-I: interactive;

-F : Mandatory

three.. rm:remove, deleting

rm [Option]....file..

Common options:

-I: Interactive

-F: Force delete

-R: Recursive

RF options are typically used


This article is from the "9470860" blog, please be sure to keep this source http://9480860.blog.51cto.com/9470860/1696511

Linux Basic file Management 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.