Linux Common commands
1. Copy, delete, and move commands for Linux files
CP Copy, equivalent to "copy" in DOS
Usage: # CP [Options] source file or directory destination file or directory <Enter>
Common parameters:
-I interactive, inquiry mode. Whether to ask before overwriting
-R recursive, when copying the original folder is a directory file, the destination must be a directory name
# cp-i install.log/tmp<enter>//Normal
# cp-i install.log/tmp<enter>//Ask,<y> cover
# cp-r/root/tmp<enter>//Copy Folder
MV Move, rename, equivalent to "move" in DOS
Usage: # MV [options] source file or directory destination file or directory <Enter>
-I interactive, inquiry mode.
-F force, forced operation, not asked.
# Mv/tmp/install.log .<enter>//target exists, mobile
# Mv/tmp/install.log ./i3<enter>//target does not exist, rename
# CP I3/tmp<enter>
# mv-i i3/tmp<enter>//Enquiry
# mv-f A*.*/tmp/i3<enter>//Don't Ask
rm (remove) Delete files, folders, equivalent to "Del" in DOS
Usage: # RM [Options] File <Enter>
-I,-R,-F ibid. " -R "To remove all directories and subdirectories recursively, primarily for folders
# mkdir folder<enter>//Create Folder
# Touch folder/{a,b,c}<enter>//Generate ABC three files
# ls folder<enter>//Confirm 3 files
# rm-i folder/a<enter>//Delete folder under a file
# ls folder<enter>//confirm missing a file
# RM-RF folder<enter>//Delete folder
2, the creation and deletion of the Linux directory command
mkdir Create folder, DOS with
Usage: # mkdir [Options] folder name <Enter>
-p parents, parents. When the parent folder does not exist, create the parent folder first
# mkdir/tmp/haha<enter> ==> # file/tmp/haha<enter>
# mkdir-p/tmp/a/b/c/d<enter> ==> # file/tmp/a/b/c/d<enter>
# mkdir/tmp/{x,y,z}<enter>
rmdir Delete empty folders, DOS with
Usage: # rmdir [Options] folder name <Enter>
# Rmdir/tmp/a/b/c/d<enter>//Success
# rmdir/tmp/a/b<enter>//unsuccessful
CD Change directory, DOS with
Usage: # cd [Folder]<enter>
-//current directory and previous working directory switch
~//Household Directory
# CD-<enter> ==> # pwd<enter>
# CD ~<enter> ==> # pwd<enter>