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.
-
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!.
-
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?
-
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?
-
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?
-
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?
-
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?
-
At the command prompt, type which grep and press Enter. Did the which command find the file? Why?
-
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?
-
At the command prompt, type find /root name "sample" and press Enter. What files are listed? Why?
-
At the command prompt, type find /root type l and press Enter. What files are listed? Why?
-
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.
-
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