Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Project 4 - 3 ESTIMATED TIME: 2 0 minutes OBJECTIVE: Organize files and directories. DESCRIPTION: In this hands - on project, you use the mv
Project
ESTIMATED TIME: minutes
OBJECTIVE: Organize files and directories.
DESCRIPTION: In this handson project, you use the mv command to rename and move files and directories.
Switch to a commandline terminal tty by pressing CtrlAltF 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 sample and press Enter. What error message was displayed and why?
At the command prompt, type mv sample sample and press Enter. Next, type ls F sample at the command prompt and press Enter. How many files are listed and what are their names? What happened to sample
At the command prompt, type mv sample mysamples and press Enter. Next, type ls F sample at the command prompt and press Enter. How many files are there and what are their names? Where did sample go
At the command prompt, type cd mysamples and press Enter. Next, type ls F sample at the command prompt and press Enter. Notice that the sample file you moved in Step was moved here.
At the command prompt, type mv sample and press Enter. Next, type ls F sample at the command prompt and press Enter. How many files are there and what are their names? Where did the sample 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 sample
At the command prompt, type mv sample mysamplessample 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 sample in the destination folder.
At the command prompt, type ls F sample and press Enter. How many files are there and why?
At the command prompt, type mv sample mysamples and press Enter. Type y and press Enter to confirm you want to overwrite the file sampleB in the destination directory.
At the command prompt, type ls F sample 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started