Linux File management Tools

Source: Internet
Author: User

Linux File management tools: CP, MV, RM

1, Cp:copy

Source file: Destination file

Single source copy: CP [OPTIONS] ... [-T] SOURCE DEST

If the dest (target) does not exist, the data stream is created and copied to the target file;

Eg: Copy the etc/passwd to/tmp/passwd.bak and the destination file does not exist, so it will be created automatically Passwd.bak

cp-v/etc/passwd/tmp/passwd.bak

if DEST (target) exists, then overwrite the target file;

Eg: the destination file is overwritten because the destination file already exists.

cp-v/etc/passwd/tmp/passwd.bak

Multi-source replication: CP [OPTION] ... SOURCE ... DIRECTORY

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

If the dest does not exist: error;

if dest exists:

If Dest is a non-directory file: error;

if Dest is a directory file: Copy each file to the target directory separately and keep the original original;

Common options:                         

-I: Interactive replication, that is, before overwriting to remind users to confirm;

- F: Force overwrite the target file;

-R,-r: Recursive copy directory;

-D: Copies the symbolic link file itself, not the source file it points to;

-a:-dr--preserve=all, archive, for archiving;

--preserv=

Mode: Permissions

ownership: A group of owners and genera

timestamps: Time stamp

Context: Security label

xattr: Extended Properties

Links : Symbolic links

all: All of the above properties

2. MV Command: Move

MV [OPTION] ... [-T] SOURCE DEST

MV [OPTION] ... SOURCE ... DIRECTORY

MV [OPTION] ...-t DIRECTORY SOURCE:


Common options:

-I: interactive;

-f:force


3. RM Command: Remove

RM [OPTION] ... FILE ...


Common options:

-i:interactive

-f:force

-r:recursive


Delete directory: Rm-rf/path/to/dir

Hazardous operation: RM-RF/*




Linux File management Tools

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.