Locate files on linux, FreeBSD and UNIX system

Posted on in Categories , , , , , last updated January 31, 2007

Q. How do I locate files on Debian Linux?

A. You can use find and locate command.

find command search a file system in real time. So depending on the size of your file system (partition) and the depth of your search, the find command can sometime take a long time to scan all of the data.
To search your entire filesystem for the files called resume.doc type
$ find / -name resume.doc

locate command list or display files in databases that match a given filenames. This is not a real time reporting. The data reported in the output of locate isn’t as fresh as the data reported by find. However it is the fastest way to find a file.
$ locate resume.doc

More Find command examples

Please see following previous examples for more information:

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

1 comment

Leave a Comment