Problem

In this hands-on project, you find files on the filesystem using the find, locate, and w...

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

1. Switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the terminal using the user name of root and the password of secret.

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? 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 /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 find /root –name "sample" and press Enter. What files are listed? Why?

9. At the command prompt, type find /root –type l and press Enter. (Note that the last character in this command is the lowercase letter "l" and not the number one.) What files are listed? Why?

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

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

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search