Create directory:
Mkdir directory
Mkdir [-M] [-p] Directory
-M: Specifies the attribute. You can also use the CHMOD command to modify the attribute later.
-P specifies the directory. By default, a new directory is created in the current directory.
RmDelete a file or directory (you can use a regular expression)
Usage: Rm [Option]... file...-F, -- Force Delete. Ignore nonexistent files and do not Prompt confirmation-I need to confirm before deleting-I requires confirmation before deleting more than three files or recursively deleting. This option is less content than-I prompts, but it can also prevent most errors from-R,-R, -- Recursive recursive deletion of directories and their content //-V is required to delete directories, -- verbose detailed display steps
For example:
Delete all files in the current directory, force Delete, no prompt
rm -f *.*
Delete the directory you just created
rm -rf code
MVMove a file or directory
For example, move the sibling directory of the parent directory to the current directory in the subdirectory:
MV ../instruction.
Music videos can also be used to rename files or directories.
MV gzip.txt tar.txt
CPCopy
CP-copy files and directories
Synopsis
CP [Option]... [-T] source dest
CP [Option]... source... directory
CP [Option]...-T directory source...
Description
Copy source to DEST, or multiple source (s) to directory.
Mandatory arguments to long options are mandatory for short options too.
-A, -- Archive
Same as-dr -- preserve = all
-- Backup [= control]
Make a backup of each existing destination file
-B like -- backup but does not accept an argument
-- Copy-Contents
Copy contents of special files when recursive
-D same as -- no-dereference -- preserve = links
-F, -- force
If an existing destination file cannot be opened, remove it and try again (redundant if the-n option is used)
-I, -- interactive
Prompt before overwrite (overrides a previous-N option)
-L, -- Link
Link files instead of copying
-L, -- Dereference
Always follow symbolic links in Source
-N, -- no-clobber
Do not overwrite an existing file (overrides a previous-I option)
-P, -- no-Dereference
Never follow symbolic links in Source
Frequently used:
-A: equivalent to-PDR
-I: Prompt
-F: Forced copy (replacement)
-R: recursive replication, applicable to directories