Question: Linux please help Project 4-3 In this hands-on project, you use the mv command to rename files and directories. Switch to a command-line terminal (tty5)
Linux please help
Project 4-3
In this hands-on project, you use the mv command to rename files and directories.
-
Switch to a command-line terminal (tty5) by pressing Ctrl1Alt1F5 and log in to the terminal using the user name of root and the password of LINUXrocks!.
-
Next, type ls -F at the command prompt and press Enter. Note the contents of your home folder.
-
At the command prompt, type mv sample1 and press Enter. What error message was displayed and why?
-
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?
-
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?
-
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.
-
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?
-
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.
-
At the command prompt, type mv sample4 mysamples/sample2 and press Enter. What message appeared on the screen and why?
-
Type y and press Enter to confirm you want to overwrite the file in the destination folder.
-
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.
-
At the command prompt, type ls -F and press Enter. How many files are there and why?
-
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.
-
At the command prompt, type ls -F and press Enter. Notice that there are no sample files in the /root directory.
-
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.
-
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?
-
Type exit and press Enter to log out of your shell.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
