In this lab, students will find files on the local file system.
Outcomes
The user will search files with locate and find.
Use the locate command to find various different files on the serverX machine.
Even though the locate database is updated automatically every day, make sure the database is up-to-date by manually starting an update on serverX.
[root@serverX ~]#updatedb
Locate the configuration file logrotate.conf on serverX.
[root@serverX ~]#locate logrotate.conf/etc/logrotate.conf /usr/share/man/man5/logrotate.conf.5.gz
Locate the configuration file networkmanager.conf, ignoring case, on serverX.
[root@serverX ~]#locate -i networkmanager.conf/etc/NetworkManager/NetworkManager.conf /etc/dbus-1/system.d/org.freedesktop.NetworkManager.conf /usr/share/man/man5/NetworkManager.conf.5.gz
Use the find command to perform real-time searches on the serverX machine according to the following requirements:
Find all files in the /var/lib directory owned by user chrony on serverX.
[root@serverX ~]#find /var/lib -user chrony/var/lib/chrony
List all files in the /var directory owned by user root and group mail.
[root@serverX ~]#find /var -user root -group mail/var/spool/mail /var/spool/mail/root
List all files in the /usr/bin directory with a file size greater than 50 kilobytes.
[root@serverX ~]#find /usr/bin -size +50k/usr/bin/pre-grohtml /usr/bin/iconv /usr/bin/localedef /usr/bin/rpcgen /usr/bin/less ...
Find all files in the /home/student directory that have not been changed in the last 120 minutes on serverX.
[root@serverX ~]#find /home/student -mmin +120/home/student /home/student/.bash_logout /home/student/.bash_profile /home/student/.bashrc /home/student/.ssh ...
Find all files in the /tmp directory that have been changed in the last 240 minutes on serverX.
[root@serverX ~]#find /tmp -mmin -240/tmp /tmp/.X11-unix /tmp/.X11-unix/X0 /tmp/.ICE-unix ...