How do you usually find files on Linux without wasting time?
Posted by gilko86@reddit | linux | View on Reddit | 176 comments
I mostly use find, but it can feel slow and a bit confusing with all the options. I recently started trying locate, and it’s much faster, but I know it depends on a database that isn’t always up to date.
So I’m trying to understand when to use each one. Do you rely on find for accuracy and locate for speed, or just stick to one? Also, what commands or flags do you use most often in real use?
I found a guide online on ,,find and locate'' which explains the basics clearly, but I want to know how people actually use these tools daily.
What’s your go-to method when searching for files?
scottchiefbaker@reddit
I gave up on find a long time ago. It works, but it's just not intuitive and it's slow. Give fd a try instead. It's way faster, more intuitive, matches based on regexp, etc. It's better than find in just about every way.
Fiftybottles@reddit
The syntax is a tad esoteric, but idk that I find find to be all that tough? In most cases it's as easy as
find . -iname "\*thing_i_want\*"from whatever directory. That can also be easily turned into a one-line function snd tossed into your .bashrc or wherever else.Granted, that's obviously still more verbose than
fd, but not enough to kill the tool for me or convince me to stray from a core utility.CramNBL@reddit
The difference in speed is just night and day though. Same with grep vs ripgrep.
Fiftybottles@reddit
That's a fair and valid point, I think for my personal use case though I just don't really notice that difference. Most of the time, I'm pruning out irrelevant cache directories with a ton of files in them which would slow down searches anyway. Typically I'm just trying to find some text file in my documents, or find everything ending with a certain extension so I can move them somewhere else en masse.
Jean_Luc_Lesmouches@reddit
What always trips me up with find is that the what to search / where to search order is reversed relative to grep
tavianator@reddit
This is one big reason I wrote bfs which is compatible with find but also accepts
bfs -name '*.txt' ~/DownloadsFiftybottles@reddit
Once I realised find is basically just its own micro-language it stopped tripping me up. The only "order" you really have to remember if you just want to perform a basic filesearch is
find [folder_to_search] [commands]. The commands are then just evaluated, in order, one-by-one.This blog post was actually pretty instructive for me in understanding how the
findmicro-language works at its core.kriebz@reddit
Yes! Good advice. I'll have to read this blog. I hate that order matters. I once had a long sad night doing some file restores after I put -delete ahead of -name.
Fiftybottles@reddit
Oh man... The order mattering really confused the hell out of me at first too, particularly with prune. I couldn't for the life of me put together how it actually affected my search; not understanding that the command was actually evaluating my input like a script made it a lot harder to grasp for me, at the time.
FrankVanDamme@reddit
- always check before you add -delete
- prune is handy. find bla/ -name largefolder -prune -or -name somefile.txt
that'll look for the file, except in directories named largefolder
Jean_Luc_Lesmouches@reddit
"The best way to remember it is to remember it" has to be one of the most deluded, unhelpful comments I've ever seen
Fiftybottles@reddit
Not what I said, and I also provided a link which explains the fundamental design of the expression language which is evaluated every time you run the command, so I'm not sure why you're being so hostile.
gilko86@reddit (OP)
thx
CaptainEdMercer@reddit
I've also found that ripgrep makes a perfect companion to fdfind.
scottchiefbaker@reddit
Indeed. They are two indispensable tools in my workflow.
LocalNightDrummer@reddit
Same for me.
epikurious@reddit
This is the best way.
Just a reminder that it's called fd-find in some dstros.
CWRau@reddit
+1 for fd, was going to recommend that as well
rastyk1@reddit
You have to figure out what you know about the files first and then use what you have to start.
There are some tricks like -newerXY and, as was mentioned, -iname. If you can narrow down your search to specific directories or size, that makes a difference.
And you can be lazy if you can make good assumptions. If you know your file is big, the size will be key. If it was written yesterday, -mtime will matter more perhaps.
Of course, ‘man find’ is the place to go, but I hope it’s better to give those ideas before people start looking there. Good luck!
Moons_of_Moons@reddit
Just put 100% of your files on the desktop. There they are. Found ✅
Early_Host3113@reddit
Truthfully, I don't get to use Linux for work so... I just waste time. :D
Barrions@reddit
fdandfzfall the waywezelboy@reddit
updatedb then locate
m15f1t@reddit
So.. Basically find.
troyvit@reddit
find does a fresh read on the filesystem every time you run it. locate uses a pre-built database of your filesystem to find stuff, so it's much faster. The trade-off is that if you created the file you're looking for and updatedb hasn't run yet, locate won't find it.
There are tons of other differences but that architectural difference is the important one to me.
CWRau@reddit
Fresh read is kinda exaggerated tho, the kernel caches a lot. fd and rg are core tools in my workflow, both searching through my entire home directory with millions upon millions of files, gigabytes of data and only the first run takes a little bit of time, every time else it's maybe 4 seconds
troyvit@reddit
Oooh good point. I wondered why similar `find` commands would run faster. Like it's not even on the same directory but it's a similar command. I think there's a lot more to find than I gave it credit for.
m15f1t@reddit
I know how it works but if you want to find a file and run both commands as he said it's basically the same as using find in the first place?
wezelboy@reddit
Syntax is different. Others have said find is cumbersome and I’m inclined to agree with them.
roadit@reddit
Only on SunOS 4 ...
wezelboy@reddit
Um.. no.
gilko86@reddit (OP)
thanks!
duffer_dev@reddit
This is one of the first package I install after a fresh install.
manny2206@reddit
Might have to try that real quick
pieplu@reddit
or mlocate
courtarro@reddit
plocate is the newer, faster replacement for mlocate.
dingman58@reddit
m'locate (tips fedora)
pocketgravel@reddit
And if this doesn't work I have fsearch installed which is like the Linux version of everything.
todd_dayz@reddit
I just either use plocate locate, or an alias I made to run systemctl start plocate-updatedb && locate, depending on what I want to find.
PocketStationMonk@reddit
I press SUPER and type in whatever I’m trying to find. So far it’s worked fine.
gilko86@reddit (OP)
thanks
AmarildoJr@reddit
I've gotta be the only one using my file manager's default search function? xD
gilko86@reddit (OP)
hahah, maybe ))
ButterflyMundane7187@reddit
locate and grep
gilko86@reddit (OP)
thank you, mate
gosand@reddit
especially with options like -i (both) and -v (grep)
e.g. locate -i | grep -i | grep -iv ......
Have your system do the updatedb daily so it's up to date. (e.g. /etc/cron.daily/plocate)
faramirza77@reddit
Locate if I know what file but not where. fd or bfs for pattern searching
Xatraxalian@reddit
For binaries: which.
For normal files such as documents, I use the filter find function in Dolphin in KDE. If I don't know where a file is, I use KFind.
stejoo@reddit
Using
whichis often fine, but I recommendtypeinstead of it. The second is in the know of shell builtins and configuration (aliases and functions for example).BinkReddit@reddit
Same; the filter function in Dolphin is game-changing.
duva_@reddit
I think I open dolphin once a month lol
TheOgGhadTurner@reddit
I’m new to KDE in general so I’m going to try this out I generally just do search and it’s… fine I guess lol
TheBlackCarlo@reddit
If it's just a question of finding a file by its name, then i just do:
and then I parse the text file either with grep, or with the search function (/) inside vim.
Basically I decide when to create the database of files (files.txt) and of what. Then I just use normal terminal tools to search stuff.
philemon-phonon@reddit
Same here but navigate files.txt with Emacs + M-x occur, grep, whatever
mrtruthiness@reddit
Yes! Usually piped to grep for me.
Often I narrow the date/time range:
Or ... to look at files last modified 2025:
Or if you remember that it has been modified within the last 30 days:
Or if it has been modified in the last 90 days, but not within the last 30 days:
0x80070002@reddit
Can’t you just remember them? Just memorize where you have all your files then you don’t have to search for them. And I am not even joking, I learned to do this on Windows where search never worked good after Win98.
manny2206@reddit
Nah fzf is best
brandmeist3r@reddit
yeah, I use it all the time with these cli options as custom alias
manny2206@reddit
Brody would you do a breakdown of the flags and how you use it?👀
brandmeist3r@reddit
the preview shows the file contents on the right half, it only works with {}, otherwise the preview is empty
saunderez@reddit
Damn straight it is
pouetpouetcamion2@reddit
fzf
Background-Train-104@reddit
nvim -p $(find | grep)
Wasting zero time
vestern@reddit
find /dir - xdev -iname thing
PhotographingNature@reddit
Find. I'll accept the time penalty for knowing it'll look for exactly what I ask for.
githman@reddit
find | grepbecause it does not rely on any pre-built caches that happen to be outdated exactly when you need them the most. Admittedly, sometimes I chain greps instead of taking the high road with a sophisticated regex.insanemal@reddit
I don't lose them in the first place?
I rarely ever need to "find" a file.
TerribleReason4195@reddit
I don't search for files. I know where each file is on my computer.
nifoj@reddit
What if you uninstall something and want to find and delete what's left of it in your home dir?
Mordiken@reddit
find ~ -iname "*app_name*"Where
app_nameis the name of the program you've uninstalled.TerribleReason4195@reddit
I think what you are mentioning is usually git. When you git clone something it, you copy a folder from the repo. You can obviously remove it depending where you cloned it to. There is also an option in most package managers to purge the files when removing the package that you installed.
hardlying@reddit
I can't think of any reason Id be searching for a file without knowing the directory
TerribleReason4195@reddit
Seriously though. You must be messy to not to find what you are looking for.
Hot-Employ-3399@reddit
Fd. it's so fast I use it starting from $HOME.
akram_med@reddit
Use fzf which uses fd to display files so install both and run fzf
CarbonXit@reddit
I use fuzzy finder
s4mur4j3n@reddit
Couple of things come to mind as my "must-haves": fzf , fd and ripgrep (rg).
If you want to navigate filesystems with speed on the terminal, you should check out br (boot) as well.
FuZzy Find (fzf) is the one thing that just makes finding stuff so much easier, and you can integrate it with quite a few tools too.
Ripgrep is grep with some serious speed and some nice additions for developers.
fd or fd-find is just a more pleasant finder than find, and it is also equipped with some developer friendly features
AkelGe-1970@reddit
I know where the files are, usually. At least the directory that can contain them in some subdir, so I use find with the "general" directory as target. If I need to find a file from a package I use
dpkg -L <package>. I think I stopped runningfind /after 2/3 years of using Linux.SpeedDaemon1969@reddit
I put them in a logical place. Photos in photos directory, documents in documents directory, etc.
Altruistic_Tank_9636@reddit
That's fine if if you don't organize files into subdirectories. If you've got files spread across 30 directories under /music/projects, your method fails
oxez@reddit
That's way too smart. We're on /r/linux in 2026, using your brain is forbidden.
SpeedDaemon1969@reddit
Sorry. I will try to vibe code. I will try to vibe code.....
Jeremy_Thursday@reddit
From the terminal. Fzf. Specifically
fzf -ethen interactively type the file names. Pro tip if you leave it open, it’ll instantly be able to search everythingThe_Hamster_Shagger@reddit
I just use tracker or whatever kde uses.
aloobhujiyaay@reddit
locate is great just remember to run updatedb occasionally or it’ll betray you at the worst time
SRART25@reddit
Ssd makes it a non issue, but also you should have it running on a cron job.
stef_eda@reddit
updatedb database
Juts@reddit
export FZF_DEFAULT_OPTS='--walker file,hidden'
fzf
ExceedinglyEdible@reddit
locate. Rebuild the db through a cron task.Dolapevich@reddit
I usually decide on a pattern on where to store files, and stick to it. So... if I look for a book I know it is under
/mnt/storage/books/<author first surname letter>/<Author>/<Book name>/Can you explain what is your use case/need? Are those user or OS files?
TipAfraid4755@reddit
find / | grep
susosusosuso@reddit
Just ask the ai agent to find the file?
PeppeMonster@reddit
sudo ls -lRa | grep filename
mondshyn@reddit
fsearch
disinformationtheory@reddit
https://github.com/sharkdp/fd
It's a better
find. I usually use it overlocatebecause I'm too lazy to exclude my yocto builds which generate lots of false positives.AxeCapital13@reddit
fzf or ripgrep
Intrepid_Screen6425@reddit
I... remember every system path and every single file. Brain RAM is free and always online :))) Good luck :)))
libra00@reddit
My first stop is always locate. It doesn't always work, but when it does it's much faster and doesn't require a bunch of args and shit. After that I might fuck around with find for a minute, but then remember that I don't remember the damned syntax, and then just go use dolphin's search feature.
SheriffBartholomew@reddit
For user files? I just keep them organized in the documents folder ...
ImperfectMinimalist_@reddit
fzf
pibarnas@reddit
Look for fd in github and install it.
astronomersassn@reddit
tbh i just have my stuff sorted in a way where it doesn't take me that long to get there
i need a VST? cd /home/me/Downloads/vsts
im working on my website? cd /home/me/Documents/coding/website
or just doing that in dolphin with folders
i also tend to be able to figure it out if i forgot. "i think i sent it through kde connect, so it's probably in my downloads... there it is!" or "the most recent test mix of the song i'm working on is probably in my music folder... wait, there's a demos folder- there we go!"
im not particularly organized, some files just go in specific places and the rest are in a less organized random folder.
T8ert0t@reddit
Docfetch app
b4st14nb@reddit
using
plocate, a faster alternative tolocate. Just make sure to run frequentlysudo updatedbto update its cached DB and then typelocate + %file_name%b4st14nb@reddit
or fzf + zsh to be way more convenient tbh. Someone said that before here
NuclearGriffin@reddit
If you know the file name then just type it in the search bar. Unlike windows, the search bar actually searches your files, not Bing.
BranchLatter4294@reddit
I organize my files to make them easy to find.
saunderez@reddit
I got to the highest level that I know will contain what I'm looking for...then I use fzf and search for a few characters and it will automatically appear somewhere near the bottom of list.
DFS_0019287@reddit
I use three methods, in decreasing order of frequency:
plocateto find something quickly, often piped into grep to narrow it down.findifplocatefails. I don't have a problem withfind's syntax, but then again, I've been using UNIX-like systems since 1989...SoggyWalrus7893@reddit
unix was/is nice
SeriousPlankton2000@reddit
unlike other locates, plocate does by default use AND on the parameter list instead of OR.
SoggyWalrus7893@reddit
as super user find / -name xxxx
an * at the beginning of xxxx is slow , and * at the end of xxxx is speedy.
Lost4name@reddit
Catfish program.
ritonlajoie@reddit
I usually use silversearcher it's crazy fast
getapuss@reddit
Whatever the file manager is in Mint has a search button that seems to work.
valgrid@reddit
https://github.com/sharkdp/fd
za72@reddit
where
sethasaurus666@reddit
If you have thunar, from the menu : Go -> Recent
This shows recent files (e.g. something you just downloaded but have no idea of where tf it went)
Shintoz@reddit
I use find, piped to grep.
veghead@reddit
Ag or rg are the best companions when you're searching for content. Locate is still my goto for finding by filename. In fact I get really annoyed when I'm using someone's machine that hasn't at least initialised locate and installed ag.
Joedirty18@reddit
Well firstly im organized enough i usualy dont need it but when i use find i just always make sure to include - maxdepth. Even if you arent sure of the folder location you should still be able to set a reasonable limit so it doesn't take forever.
EnvironmentalCook520@reddit
There's a gui tool called catfish. On windows I used a tool called search everything, and I wanted a similar tool on Linux and found catfish
JDGumby@reddit
I just do what any normal person does and use whatever graphical file search tool that comes with my distro/DE (
catfishin the case of Mint Xfce, called 'File Search` in the menu if you leave the default generic names on :P).InfaSyn@reddit
kfind for gui, find command for cli
chris32457@reddit
click dolphin
Literallyapig@reddit
honestly, i use find with no arguments besides the path and pipe it into grep (ripgrep in my case), simply because i hate find's interface. there are certainly better ways to find stuff, but this has always worked for me lol
revilo-1988@reddit
Find, grep, locate
CurTOGuy@reddit
Try Recoll. It can find anything. It can even search within text of emails.
https://www.recoll.org/index.html
IADGAF@reddit
Fsearch
lKrauzer@reddit
Both Dolphin and Nautilus are pretty good for my use-case. I use both GNOME and Plasma installed on my distro (dualboot Fedora/Ubuntu).
TONKAHANAH@reddit
The search feature in dolphin just never worked for me for the longest time, even across different systems.
Then one day it just worked and it's been pretty good since.
dzuczek@reddit
Plasma also uses Baloo for file indexing
cmrd_msr@reddit
alt+space=>filename=>enter
DruidPeter4@reddit
If it's an executable on the system path you can use whereis. If you know what it's called, then bare minimum you can just use 'find | grep' or 'tree | grep'.
_SuperStraight@reddit
catfish file search
vmcrash@reddit
Midnight commander
BitOBear@reddit
Well you should have a guess about where the file might be instead of finding across your entire device.
If you're only looking for one file using update DB before the locate that's about the same cost as doing a fine but you're just not watching it take that time. You psychologically assigned the effort to the locate command and ignore the amount of time updatedb was running.
Meanwhile if you forget to do the update just carrying around a lot of stale data.
Remembering to do things like use the mount argument and picking something other than the root of your file system makes find cost basically the same. Particularly if you use iname instead of name.
ThellraAK@reddit
Fuck
signalno11@reddit
Don't forget https://github.com/nvbn/thefuck
WeAreAlreadyCyborgs@reddit
For a binary
Which is the binary invoked by default
Which is all the binaries installed on the system named that and where they are.
For any other file, let me introduce you to the awesomeness that is FSearch: https://cboxdoerfer.github.io/fsearch/
Point it at directories, run a scan, and it creates a database that is INSTANTLY searchable as you type. Also has regex, filters, a bunch of options. One of the most useful tools I use.
If you need to search for text within files, ripgrep and ripgrep-all are my go-to, as it is a faster Rust version of grep, including the ability to look in PDFs, Office Docs, E-Books, etc with ripgrep-all.
ygonspic@reddit
I use fd (sharkps find implementation)
Foxler2010@reddit
I know find is slow but it's standard and works on many systems. Since I am often jumping around and remoting between many different computers, I just stick with it even if it's not the best.
gtrash81@reddit
Well, the command "find" crawls through the whole disk.
A second run is faster, because Linux saved the filesystem index into the RAM.
Easiest way to use "find" would be "find / -name fileLookingFor".
The command "locate" works on a database that either will be updated by a cronjob or by the command "updatedb".
The first run of updatedb will be slow too, because it crawls through the whole filesystem too.
Accurate_Estimate811@reddit
Always used locate
fata1w0und@reddit
Install plocate. Run updatedb as root/sudo. To find a file “locate”
edernucci@reddit
fzf
CGA1@reddit
Terminal, create an alias:
Otherwise, Fsearch.
Slight_Manufacturer6@reddit
Fuzzy find or locate
PicardovaKosa@reddit
i am rarely in a position to have to find a file that i know the name of.
More often i want to find a text file that i know contents of, but dont know the name or place.
For this, I just use awk.
Agron7000@reddit
ugrep is the fastest search tool in the world, it's written in C++ and it beats C and Rust versions. Plus it can search inside zip archives, pdf, documents and more.
It's super lean and super fast.
https://ugrep.com/
sumsabumba@reddit
Fzf is nice
archontwo@reddit
First step to finding things is to think about where you put them in the first place.
One of the bad habits I have to break from windows refugees is to not save everything to Downloads.
I tell them to think about the type of file they are saving, why they are saving it, and where it ought best to be filed. So an invoice should be in personal, purchasing and whatever sub division of that to keep it sane.
It takes a couple of hours to drill them but in the end they not only get it, but end up loving how they can organise their files in ways they never thought of before.
MatchingTurret@reddit
find . -type f -iname "*.whatever" -print0 | xargs -0 ug "what I'm looking for"LightBusterX@reddit
The best and most obvious method is KRunner
fellipec@reddit
locate on the tui, FSearch on the gui
andyniemi@reddit
mlocate/plocate
TheSodesa@reddit
I use
fd. Might have to be installed viacargoorbrew, though.Zdrobot@reddit
I use Midnight Commander ¯\_(ツ)_/¯
tuerda@reddit
Used to use
locate. Switched tofd. I only ever used find for the--execfunctionality, but fd does that too, so I might never use find or locate again.SeriousPlankton2000@reddit
locate (package plocate)
kelek_s@reddit
If you're patient (it's an whole world) and willing to learn, maybe should you try the grep journey: -> https://man7.org/linux/man-pages/man1/grep.1.html https://phoenixnap.com/kb/grep-command-linux-unix-examples
michaelpaoli@reddit
I don't bother with locate nor have it installed, it's mostly out-of-date limited information, and a lot of regular I/O burn and space consumption, for not all that much use.
I use find all the time. To be efficient, don't examine/traverse what's unnecessary. Use reasonably appropriate filtering, mostly with find itself, to quickly hone in on the item(s) of interest. So, e.g., as appropriate, with find, shell, etc., use -xdev 2>>/dev/null -prune -newer -mtime ! -type X (), -ino, !, -o, -depth, |, sort, head, etc.
pixelbart@reddit
In .bashrc:
shopt -s globstar
Then use ls to recursively search for any html files:
$ ls */.html
stiggg@reddit
Only find. I don’t think it’s too slow with modern SSDs, but when I search a file I’ve usually a glue where it might be and specifying a subdirectory. Worst case is maybe I’m searching inside the whole /usr. Back in the day with spinning IDE HDDs this was another story, locate was way more essential in these days.
daemonpenguin@reddit
While this is true, the database is typically updated once per day. So unless you know the file you are searching for is less than a day old, it's safe to use the "locate" command. And in most cases you probably shouldn't unless you are seeking a file using identifiers other than its name.
For example, if you want to purge all files in a directory over a month old, then "find" is ideal because it can check modified times, not just names.
SufficientVanilla354@reddit
fzf pluggin in terminal? or i mostly remember paths of important folders
RudePragmatist@reddit
find and grep are your friends.
Electrical_Tomato_73@reddit
I mostly use my memory and a reasonable hierarchy. If I vaguely remember the filename and what level of directory it may be in, I may do "ls */*pattern*" (something like that; as many levels of */* as required). In practice that's fast enough for me.
fibonacci8@reddit
find | grep "what I'm looking for goes here"
CatoDomine@reddit
I like fzf
I use it combined with tab completion in bash
kwyxz@reddit
I use locate with an automated daily updatedb.
Melodic_Respond6011@reddit
Configuration and global files, locate
Working project files within certain folder, fzf
Puchann@reddit
What files that you need to use locate and find? Tools are mostly used for script. The best method is organizing properly, I have a folder for work, a folder for personal things, a folder for config,....
k-phi@reddit
built-in search in
mcLocationReady788@reddit
Io adoro KDE e grazie a dolphin ci sono due strumenti fantastici 😄
-1 filtro in basso e
-2 Cerca file e cartelle
per me sono 2 cose fondamentali che mi permettono di affinare la ricerca cosa che su cinnamon non riesco a fare ad esempio
lendarker@reddit
As always, it depends. Looking for a binary/command? -> which
Usually I use find otherwise, but I also usually have a good general idea on where a file should be, so I don't need to start the search at the root directory.