Linux Tutorial Series

Linux Tutorial Series – 72 – The find command

Here is the video version, if you prefer it:

The find command is used to find files. (Ward, 2014)⁠ There are a lot of options to find, but I remember it simply as this:

find dir -name file -print

where dir is a directory from where to start the search and file is the file name I’m looking for. To elaborate more on the dir part – find will find files in the directory dir or a subdirectory of dir, but it will not go upwards of dir. For example, if my find starts like this:

find /home/mislav …

it will not look outside the mislav folder, just “further down”. That means it is impossible for me to get a result such as /home/jellyfish/… .

-name is followed by the name of the file you are looking for. -print is used to instruct find to print the full file name on the standard output, followed by a newline. (“FIND(1),” n.d.)⁠

Some examples of find:

mislav@mislavovo-racunalo:~/Linux_folder$ find /home -name ab -print








mislav@mislavovo-racunalo:~/Linux_folder$ find /home -name ab.txt -print


mislav@mislavovo-racunalo:~/Linux_folder$ find /home -name 'ab*' -print | grep Linux_folder






I always used find to find a particular file (such as some files I needed which relate to software development), so I never needed to use other find functionalities (and there are many). I found a good guide for functionalities of find I didn’t cover here: (“A find Tutorial and Primer,” n.d.)⁠, although again, other than memorizing this short line at the beginning of this post and using it, I never used anything else besides that.

“What’s the difference between locate and find?” you may ask. Well, the astute reader (and I hate when someone writes this as I always feel bad) will have noticed that locate operates on a database. So, if some file entry wasn’t added to the database locate operates on, locate won’t find it, but find will. So find is more powerful than locate in the sense that it doesn’t rely on a database which can be incomplete at a given moment. I have used find much more often than locate.

Hope you learned something useful!


A find Tutorial and Primer. (n.d.). Retrieved February 6, 2020, from

FIND(1). (n.d.). Retrieved February 6, 2020, from

Ward, B. (2014). How Linux Works: What Every Superuser Should Know (2nd ed.). No Starch Press. Page 20

NewsletterUpdates on interesting things I am doing

Subscribe to my newsletter to keep abreast of the interesting things I'm doing. I will send you the newsletter only when there is something interesting. This means 0% spam, 100% interesting content.

Leave a Reply

Your email address will not be published. Required fields are marked *