Use Find and Locate to Search for Files in Linux
Learn On Demand Pro Series

Did you know Cybrary has FREE video training? Join more than 2,500,000 IT and cyber security professionals, students, career changers, and more, growing their careers on Cybrary.

Time
1 hour
Difficulty
Intermediate

In this IT Pro Challenge provided by Learn on Demand Systems you will search for files by using the find and locate commands. Files will be found by criteria such as name, size, recent modification, ...

Did you know Cybrary has FREE video training? Join more than 2,500,000 IT and cyber security professionals, students, career changers, and more, growing their careers on Cybrary.

Overview

Objectives:

  1. To search the hard drive by using the find command.
  2. To search by using the locate command and the mlocate database.
  3. To display information about a command by using the whatis, whereis, and which commands.

Tasks:

  1. Search for files by using the find command.
  2. Search for files by using the locate command.
  3. Search for information about the date command by using the whereis and which commands.

Skills: Learn to use Command Line Interface User Commands such as whereis, touch, dd, date; the whatis Manual Pager Utility command; the System Manager's Manual command - updatedb and General Manual Commands such as find, locate, which, and nano. Search for files by using the criteria such as name, size, recent modification, etc. implementing the find and locate commands.

Introduction: The Learn on Demand Systems' Use Find and Locate to Search for Files in Linux is a premium Cybrary lab that trains students to learn General Manual Commands such as find and locate in the Command Line Interface as well as Manual Pager utility whatis, and User Command whereis to locate the executables, man pages and supporting files of a particular specific command or a utility. The Use Find and Locate to Search for Files in Linux lab is intended for Intermediate level students and learners.

The Learn on Demand Systems' Use Find and Locate to Search for Files in Linux Lab is aimed towards the System Administrator work profile. Upon successful completion of Learn on Demand Systems' Use Find and Locate to Search for Files in Linux Lab, the student will be able to search for files by using criteria such as name, and file size as well as the index database. Learn on Demand Systems' Use Find and Locate to Search for Files in Linux Lab takes 45-60 minutes to complete for most students.

Skills/Activity Breakdown: The Lab aims at teaching students to create users using useradd System Management utility in Linux. Also, it includes a tutorial to create user groups and directories to the user accounts created and using groupadd System Management utility, while also setting up read-write-execute-access permissions for these user accounts and groups. A student learns proper usage of useradd and groupadd utilities of system managing operations.

The Lab also aims at teaching students to search for files using the find command. Also, it includes a tutorial to create a 50MB file in /root directory by using the dd command, while also utilizing special operators such as * and % to enable pattern matching file search. A student learns proper usage of searching files in a User's home directory by implementing lower case search strings with the find command. Working with the find command-line utility allows administrators to search a particular file or pattern matching files and edit them as well as list out its assigned permissions of the various resources in the Linux system.

The Lab also aims at teaching students to search for files using the locate command. Also, it includes a tutorial to update the database by using the mlocate and updatedb commands, while also utilizing locate command to gather statistics about the mlocate database. A student learns proper usage of locating files in a User's home directory by implementing lower case search strings with the locate command. Working with the locate command-line utility allows administrators to locate a particular file or pattern matching files and edit them as well as list out its assigned permissions of the various resources in the Linux system.

The Lab teaches students to search for information about the commands, executables, and supporting files installed about the command-line utilities on the Linux system. Commands such as whereis, whatis, and locate are utilized to search for information such as command executables, man pages and supporting files about the date command to show an example.

Completion of Learn on Demand Systems' Use Find and Locate to Search for Files in Linux Lab means that the student has demonstrated the ability to use Linux Command Line User, General Manual, System Manager, and Manual Pager command utilities to search for files and directories inside User's home directories as well as list out the file's access permissions and test the access privileges in Linux environment.

Scenario: You are a system administrator for a company that uses Linux file servers. You need to search for files by using criteria such as name, and file size implementing the General Commands - find and locate. You will use the find command to search for files directly on the drive. Next, you will use an index database to search for files by using the locate command. Finally, you will search for information about commands by using whereis and which. You will be using User commands, Manual Pager Utility commands, System Manager's Manual commands as well as General Manual commands.

Environment: You will use a default installation of CentOS 7 Linux with the Server with the GUI package installed. Non-privileged accounts have been created for you. You will be guided through the process of adding software if necessary.

NOTE: An Advanced Challenge is similar to a traditional lab, but replaces the step-by-step instructions with goals and objectives along with detailed hints, which allow students to check their work as they progress. Before you begin, please ensure you have set aside enough time to complete this challenge as you will not be able to pause, save, or return to your progress.

Learn on Demand Systems' Use Find and Locate to Search for Files in Linux Lab is a part of the Linux: Command-Line and File System-Challenge Series Learning path presented by Cybrary and the lab is created by Learn on Demand Systems.

Click on the Launch the Lab button to assess your knowledge about the Linux Command Line find and locate commands to search and locate different files as well as man pages, executables, and supporting files of the installed commands.