Question: Manipulate files and directories Linux sysadmins regularly create, modify, and delete files and directories. The following tasks require you to manage files and directories. Copy
Manipulate files and directories
Linux sysadmins regularly create, modify, and delete files and directories. The following tasks require you to manage files and directories.
Copy the optfiles directory and its contents to your home directory by using the cp command.
Change to the files directory.
Verify there are eight files, four of which are named as txt
Did you copy the optfiles directory and its contents to your home directory?
Create directories and files
Next, create a new directory and populate it with files.
Type cd to change back to the root user's home directory.
Create a new directory named documents in your home directory.
Move all the text files from the files directory into the documents directory.
Expand this content if you need help:
Use the mv command to move files.
Verify that the files with a txt name are no longer in the files directory.
Did you create the documents directory in your home directory and move all txt files into it
Remove directories and files
Delete the documents directory and its contents as it is no longer needed.
Use the cd command to change to the root user's home directory.
Remove the documents directory and all of its contents.
Expand this content if you need help:
Adding r to the rm command allows the deletion of nonempty directories. Note that this is the rm command and not the rmdir command.
Select y to confirm each deletion.
Did you remove the documents directory and its contents from your home directory?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
