Review the content of the previous section:
1. Create a file: touch command
2. Delete files: rm command
3. Move files: mv command
4. View files: cat, head, tail commands
Homework: Create a file test.txt in the root directory, create a directory test (command is mkdir), move test.txt to the test directory, and rename it to test.doc
touch test.txt
mkdir test
mv test.txt /test
mv /test/test.txt /test/test.doc
Contents of this section:
Directory related operations
1. Enter the directory: cd command
Common commands, usage, cd directory
2. Create a directory: mkdir command
Common commands, usage: mkdir directory
3. Delete directories: rmdir and rm
The rm command has been mentioned in the previous section. The effect of rmdir is the same as that of rm –df, that is, only empty directories can be deleted. To delete non-empty directories, please use rm -dfr
4. File and directory copy: cp
The cp command is very similar to the mv command, copying a file to a directory:
To copy a directory to another directory, you need to add the -r parameter:
Homework: Create directories test1, test2, create a test1.txt file in test1, and then copy the test1.txt file to the test2 folder
Video data, pay attention to the WeChat public account "Kicked Xueba"