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

Unlock the full course today

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

Finding files with find

Finding files with find - Linux Tutorial

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

Start my 1-month free trial

Finding files with find

- [Grant] Linux includes both the locate and find commands for searching the file systems. Locate is database driven and find is not, so it's slower but the results are always up to date and it's much more powerful. Although the syntax can be difficult. Let's start by using the find command to find a file by name. Unlike locate find requires a search path. Do you want to search the entire file system, just use slash as the path. We also need to elevate privileges using sudo. Type in sudo space find space slash space dash name space bzip2 and hit enter. This will search the entire file system for a file named bzip2. We get three results. We have to elevate privileges with sudo or we can't access certain files. Let's do the same search with locate. Type in locate space dash c to count space bzip2 and hit enter. The locate command found 24 files matching the name bzip2. Find only finds three. This is because locate…

Contents