
上QQ阅读APP看书,第一时间看更新
Knowledge check
For the following exercises, open up your Terminal and try to solve the following tasks:
- Create three files hacker1, hacker2, and hacker3 in your home directory.
- Create three directories Linux, Windows, and Mac in your home directory.
- Create a file named cool inside the Linux directory you created in task 2.
- Create a file named boring inside the Windows directory you created in task 2.
- Create a file named expensive in the Mac directory you created in task 2.
- Copy the two files hacker1 and hacker2 to the /tmp directory.
- Copy the two directories Windows and Mac to the /tmp directory.
- Move the file hacker3 to the /tmp directory.
- Move the directory Linux to the /tmp directory.
- Remove the file expensive from the Mac directory (in your home directory).
- Remove the directory Mac from your home directory.
- Remove the directory Windows from your home directory.
- Remove the file hacker2 from your home directory.
- Rename the file hacker1 to hacker01.
True or false
- The cp command can copy directories without using the recursive option -r.
- You have to use the recursive option -r when moving directories.
- You can use the mv command to rename files or directories.
- You can remove a non-empty directory with the rmdir command.
- You can remove a non-empty directory with the rm -r command.