1. Create a new Folder
mkdir file name
Create a new folder named Test under Home
2. New text
Create a new test.sh script under Home
3. Delete a file or folder
Delete the test directory under the home directory
This method of deleting without parameters often prompts that it cannot be deleted because of insufficient permissions.
-R is a recursive delete parameter in the table of directories and their subdirectories. The directory will be emptied and deleted. When you delete a directory that contains a write-protected file, the user is usually prompted.
-F is to not prompt the user to delete all files under the directory. Please note that it is tragic to check the path and enter into another directory.
-I is an interactive mode. With this option, the RM command prompts the user for confirmation before deleting any files.
4. Move a file or folder
MV [options] source file or directory destination file or directory
Parameters:
-I: Interactive mode operation. If the MV operation will result in overwriting an existing target file, then the system asks whether to overwrite it, asking the user to answer "y" or "n", which avoids overwriting the file by mistake.
-F: Disables interactive operation. MV operation to overwrite an existing target file without giving any indication, after specifying this parameter the I parameter will no longer work.
5. Copying files or folders
CP [Options] source files (source) destination files (destination)
Parameters:
-A: equivalent to the meaning of-pdr;
-D: If the source file is the attribute of the link file, the link file attribute is copied instead of the file itself;
-F: For force, if there is any duplication or other doubt, the user will not be asked, but forced to copy;
-I: If the destination file (destination) already exists, the overwrite will ask if the action is true!
-L: The link file for the hard link is established, not the copy file itself;
-P: Copy the past together with the attributes of the archive, rather than using the default attributes;
-R: Recursive continuous replication, used for directory replication behavior;
-S: Copy as a symbolic link file (symbolic link), i.e. "shortcut" files;
-U: Update destination If destination is older than source!
Finally, note that if the source file has more than two, then the last destination file must be "directory"!
CentOS New, delete, move, copy commands