Use of cp, rm, and mv commands and cp commands in Linux Command lines
The following content comes from laruence's private kitchen
Copy, delete, and move Linux Command lines: cp, rm, and mv
Cp (copy) replication
The cp command is used for many purposes. In addition to simple copying, you can also create a link file to compare the old and new files and update them,
And copy the entire directory.
Syntax
Cp [-adfilprsu] source file target file
Source)
Destination File (destination)
Option
-A: equivalent to-pdr. See the following document.
-D: if the source file is a link file, copy the link file property instead of the file itself.
-F: force means to overwrite existing files.
Rm (remove) Delete
Syntax
Rm [-rfi] file or directory
Option
-R: recursive operation
-F: force)
-I: The deletion prompt is displayed.
This rm-rf file/dir command is very dangerous unless it is very definite,
Otherwise, I option is recommended.
Note: this should be done when a file starts with-and is deleted.
# Rm-rf ---filename-
Add --
Or specify a file in a directory, such
# Rm-rf./-filename-
Mv (move) move a file or directory and rename it
Syntax
Mv [-finu] source destination
Mv [-finu] source... directory
Option
-F: if the target file exists, it will be overwritten.
-I: a prompt is displayed.
-N: if the target file exists, it is not overwritten.
-U: if the source file is newer than the target file, or the target file is lost, it is updated. Otherwise, it is not updated.
In the same directory, music videos can also be renamed.
# Mv abc CBA