1Navigate to your home directory by typing cd Now type ls an

1.Navigate to your home directory by typing cd. Now type ls and notice that there is a subdirectory called Downloads. Now navigate to the root of the file system by typing cd /. From here which command would you use to navigate directly into the Downloads folder that is located in your home directory?

2. From the Downloads directory which single command would you use to navigate back up one directory and then back down into the Music directory?

Which command can you use to ensure you are located in the Music directory?

3. Navigate back to your home directory. Which single command would you use to get a listing of all the files in that directory, including the hidden files, that also lists additional information about the files such as the time they were last modified and the files permissions?

4. You should still be in your home directory. From here what command would you use to get a listing of all the files in the Documents directory?

5. Navigate into the /home directory. From here what command would you use to get a listing of the contents of this directory, as well as all the contents of all the subdirectories?

6. Navigate to your home directory. From here what command would you use to display only the files that begin with “Mi” or “Pi”?

7. What command would you use to make a copy of the passwd file in the /etc directory and save it in your home directory as a file called PasswordFile?

8. What command would you use to copy only the files in the /etc directory that start with the letter “l” and end with the letter “e” into your home directory?

9. What command would you use to delete only the files in your home directory that consist of exactly 9 characters?

10. What command would you use to copy all the files in the /etc directory to a new directory in your home directory call MyEtc while also telling you what is being done as it happens?

11. Create a file called “myfile” by entering the command touch myfile. What command would you use to rename this file to “yourfile”?

12. What command would you use to make another copy of “yourfile” called “ourfile”?

13. What command would you use to delete both “yourfile” and “ourfile” at the same time?

Solution

1. Navigate to your home directory by typing cd. Now type ls and notice that there is a subdirectory called Downloads. Now navigate to the root of the file system by typing cd /. From here which command would you use to navigate directly into the Downloads folder that is located in your home directory?

cd home/

ls

cd Downloads/

2. From the Downloads directory which single command would you use to navigate back up one directory and then back down into the Music directory?

cd ..

cd Music/

Which command can you use to ensure you are located in the Music directory?

pwd

3. Navigate back to your home directory. Which single command would you use to get a listing of all the files in that directory, including the hidden files, that also lists additional information about the files such as the time they were last modified and the files permissions?

cd

ls –la | more

4. You should still be in your home directory. From here what command would you use to get a listing of all the files in the Documents directory?

ls –la /home/Documents

5. Navigate into the /home directory. From here what command would you use to get a listing of the contents of this directory, as well as all the contents of all the subdirectories?

cd

ls -R /home/

6. Navigate to your home directory. From here what command would you use to display only the files that begin with “Mi” or “Pi”?

cd

ls Mi*

ls Pi*

7. What command would you use to make a copy of the passwd file in the /etc directory and save it in your home directory as a file called PasswordFile?

cp /etc/passwd home/PasswordFile

8. What command would you use to copy only the files in the /etc directory that start with the letter “l” and end with the letter “e” into your home directory?

cp /etc/I*e /home/

9. What command would you use to delete only the files in your home directory that consist of exactly 9 characters?

rm /home/?????????

10. What command would you use to copy all the files in the /etc directory to a new directory in your home directory call MyEtc while also telling you what is being done as it happens?

cp /etc/* /home/MyEtc/

11. Create a file called “myfile” by entering the command touch myfile. What command would you use to rename this file to “yourfile”?

touch myfile

mv myfile yourfile

12. What command would you use to make another copy of “yourfile” called “ourfile”?

cp yourfile ourfile

13. What command would you use to delete both “yourfile” and “ourfile” at the same time?

rm –rf yourfile ourfile

1.Navigate to your home directory by typing cd. Now type ls and notice that there is a subdirectory called Downloads. Now navigate to the root of the file syste
1.Navigate to your home directory by typing cd. Now type ls and notice that there is a subdirectory called Downloads. Now navigate to the root of the file syste

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site