- Create a directory test mkdir/test under the root directory (/)
- Change the current directory to/test
In this directory, create an empty file with the abbreviation of your own name, and then create two subdirectories (-XH) and (AH ); mkdir-P/test/ycy/AH mkdir/test/ycy/-XH
- Go to the (-XH) subdirectory and create an empty file text1;
Touch/test/ycy/-XH/text1
- Go to the (AH) subdirectory, create a new subdirectory (ABC), and create an empty file text2;
Mkdir test/ycy/AH/ABC
Touch/test/ycy/AH/text2
- Move the newly created text1 file to the newly created ABC sub-directory, change it to text3, and copy the text2 file to the-XH sub-directory;
MV/test/ycy/-XH/text1/test/ycy/AH/ABC/text3
CP/test/ycy/AH/text2/test/ycy/-XH
- Delete the text3 file, the-XH sub-directory, and the files in the directory, and the ABC sub-directory;
Rm/test/ycy/AH/ABC/test3
Rm-RF/test/ycy/-XH
Delete A non-empty directory
Rmdir/test/ycy/AH/ABC
- Clear screen;
Clear
- Create a new directory test1 under the root directory (/), copy/etc/passwd to/test1 and/test respectively, and change the name to file1 and file respectively;
Mkdir/test1
CP/etc/passwd/test1/file1
CP/etc/passwd/test/File
- View and record the first two and last two lines of the file1 file;
Head-2/test1/file1>/fish
Tail-2/test1/file1>/fish
- View the files in the/etc/directory and record the names of the first two files;
Ls/etc | head-2> fish2
- View and record all files in the/etc/directory that contain the Sys letter;
Find-name/etc/* sys *> fish3
- View the first two files in the/etc/directory that contain Conf;
Ls/etc/* conf * | head-2
- Compress the file to/test1and name it file.gz.
Zip/test1/file.zip/test/File
- Package the file1 file into file.tar.gz and unpack it to/test;
Tar-zcvf file.tar.gz file1
Tar-zxvf file.tar.gz/test
- Create a soft link file named file. Soft to/test1;
Ln/test/file/test1/file. Soft
- Clear screen;
Clear