Problem

In this hands-on project, you use the mv command to rename files and directories. 1. Sw...

In this hands-on project, you use the mv command to rename files and directories.

1. Switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the terminal using the user name of root and the password of secret.

2. Next, type ls -F at the command prompt and press Enter. Note the contents of your home folder.

3. At the command prompt, type mv sample1 and press Enter. What error message was displayed and why?

4. At the command prompt, type mv sample1 sample4 and press Enter. Next, type ls -F at the command prompt and press Enter. How many files are listed, and what are their names? What happened to sample1?

5. At the command prompt, type mv sample4 mysamples and press Enter. Next, type ls -F at the command prompt and press Enter. How many files are there, and what are their names? Where did sample4 go?

6. At the command prompt, type cd mysamples and press Enter. Next, type ls -F at the command prompt and press Enter. Notice that the sample4 file you moved in Step 5 was moved here.

7. At the command prompt, type mv sample4 .. and press Enter. Next, type ls -F at the command prompt and press Enter. How many files are there, and what are their names? Where did the sample4 file go?

8. At the command prompt, type cd .. and press Enter. Next, type ls -F at the command prompt, and press Enter to view the new location of sample4.

9. At the command prompt, type mv sample4 mysamples/sample2 and press Enter. What message appeared on the screen and why?

10. Type y and press Enter to confirm you want to overwrite the file in the destination folder.

11. At the command prompt, type mv sample? mysamples and press Enter. Type y and press Enter to confirm you want to overwrite the file sample3 in the destination folder.

12. At the command prompt, type ls -F and press Enter. How many files are there and why?

13. At the command prompt, type mv sample1* mysamples and press Enter. Type y and press Enter to confirm you want to overwrite the file sample1B in the destination directory.

14. At the command prompt, type ls -F and press Enter. Notice that there are no sample files in the /root directory.

15. At the command prompt, type cd mysamples and press Enter. Next, type ls -F at the command prompt and press Enter. Notice that all files originally in /root have been moved to this directory.

16. At the command prompt, type cd .. and press Enter. Next, type ls -F at the command prompt and press Enter. Type mv mysamples samples and press Enter. Next, type ls -F at the command prompt and press Enter. Why did you not need to specify the recursive option to the mv command to rename the mysamples directory to samples?

17. Type exit and press Enter to log out of your shell.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search