From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Find files using locate

Find files using locate - Linux Tutorial

From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)

Start my 1-month free trial

Find files using locate

- [Instructor] The Linux directory structure is deep and has many files. Knowing how to find those files is important. Linux has two different commands for finding files, locate and find. The locate command uses a database created by the update db command. Being database driven, it's very fast but only contains files that are listed in the locate database. By default in CentOS the locate database is updated once per day by a system service. Let's search for the file name bzip2. using the locate command. In a terminal type in locate a space bzip2 and hit Enter. This will search the locate database and find files that include the name bzip2. We can count the number of files by adding the dash c option. Bring your line back and add dash c and hit Enter. We can see that we get 24 results. If you want to search for more than one file just add it to the line. Type in clear, type in locate space, bzip2 space man…

Contents