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