#学习内容来自莫烦python
mkdir Creating a folder
mkdir (make directory) is the idea of creating a folder, which is simple to use.
$ mkdir Folder2
If you want to create a folder for Folder2 inside this directory is Ok.
$ mkdir FOLDER2/F2
In this way, the F2 folder is built into the Folder2.
rmdir removing folders
RmDir (remove directory) is literally meant to remove a folder. But there is a precondition. The folders that you want to remove must be empty. Otherwise it will fail. So if you want to just build the folder2 can not be removed, because there is a F2 folder.
To remove an empty folder, for example, I'm creating a new folder3 and then removing
$ rmdir Folder3
rm Remove files from
That's the case with files in that folder, or we can use RM to remove individual files. Note: After performing RM is not able to return operations, make sure not to perform operations like this RM/, which will empty your computer.
1 Removing a single file
$ RM file1
2-I or-I are prompted to remove the file (in order to avoid accidental deletion)
-i will prompt for each file to be removed
-i more than 3 files to prompt
$ RM -I F1 F2 F3 f4
rm:remove regular empty file ' F1 '?
rm:remove regular empty file ' F2 '? y
Span style= "font-family:"microsoft yahei"" >rm:remove regular empty file ' F3 '?
rm:remove regular empty file ' F4 '? y
$ rm-i F1 F2 f3 f4
rm:remove 4 arguments? Y
3 -R or-R (recursively) is used to delete folders
Unlike RmDir, Rm-r can delete this folder if there are files in the folder. For example, there are two files of file1 and file2 in my folder1.
$ rm-r Folder1
Linux Learning notes: Basic instruction mkdir, rmdir, and RM