Question: Linux please help Project 4-5 In this hands-on project, you find files on the filesystem using the find, locate, which, type, and whereis commands. Switch

Linux please help

Project 4-5

In this hands-on project, you find files on the filesystem using the find, locate, which, type, and whereis commands.

  1. 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!.

  2. At the command prompt, type touch newfile and press Enter. Next, type locate newfile at the command prompt and press Enter. Did the locate command find the file you just created? Why?

  3. At the command prompt, type updatedb and press Enter. When the command is finished, type locate newfile at the command prompt and press Enter. Did the locate command find the file? If so, how quickly did it find it? Why?

  4. At the command prompt, type find / -name "newfile" and press Enter. Did the find command find the file? If so, how quickly did it find it? Why?

  5. At the command prompt, type find /root -name "newfile" and press Enter. Did the find command find the file? How quickly did it find it? Why?

  6. At the command prompt, type which newfile and press Enter. Did the which command find the file? Why? Type echo $PATH at the command prompt and press Enter. Is the /root directory listed in the PATH variable? Is the /usr/bin directory listed in the PATH variable?

  7. At the command prompt, type which grep and press Enter. Did the which command find the file? Why?

  8. At the command prompt, type type grep and press Enter. Next, type whereis grep and press Enter. Do these commands return less or more than the which command did in the previous step? Why?

  9. At the command prompt, type find /root name "sample" and press Enter. What files are listed? Why?

  10. At the command prompt, type find /root type l and press Enter. What files are listed? Why?

  11. At the command prompt, type find /root size 0 and press Enter. What types of files are listed? Type find / size 0 | more to see all of the files of this type on the system.

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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!