Use find when the answer must reflect the filesystem right now, or when you need filters such as file type, size, age, ownership, or permissions. Use locate when you need a fast name-based lead from an index. That index is refreshed by updatedb, so it can omit files created recently and retain paths that no longer exist. A dependable workflow is to use locate for a quick candidate path, then verify it with find before relying on the result or changing anything.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
What find, locate, and updatedb actually do
These commands answer similar-looking questions in different ways. GNU describes find as a program that searches a directory tree for a file or group of files. It walks the starting paths during your command and evaluates an expression against each directory entry. The result reflects what the filesystem contains at search time, subject to the permissions of the account running the command.
As an Amazon Associate I earn from qualifying purchases.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11locate does not normally walk the directory tree for each query. It searches one or more prebuilt filename databases. A database is much quicker for a simple name lookup, but its contents depend on when it was last generated, which directories the update configuration includes, and which paths are deliberately excluded.
updatedb creates or refreshes the database used by the installed locate implementation. On many systems it runs from a scheduled job; on others an administrator runs it manually. Running updatedb changes what later locate queries can see, not what the live filesystem contains.
#1 Best Overall
- BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
- EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
- COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
- LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
- WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
| Question | Start with | Why |
|---|---|---|
| Was this file created moments ago? | find |
It examines the current directory tree instead of waiting for an index refresh. |
| Do I need a size, type, age, ownership, or permission test? | find |
Its expression language supports metadata predicates and compound conditions. |
| Do I remember only part of a filename? | locate |
It can return indexed paths quickly using filename patterns. |
| Can I accept results that might be stale? | locate |
Its output is limited to the scope and timestamp of the filename database. |
| Am I about to modify or delete matching files? | find |
A live traversal lets you verify current existence and apply precise predicates before an action. |
The command named locate may be provided by GNU locate, mlocate, or plocate, depending on the distribution. They share the indexed-search concept, but options, quoting details, database formats, and defaults can differ. Check the local manual with man locate when a command behaves differently from the examples below.
Learn the find command syntax
The general form is:
find [starting-point...] [expression]
Everything before the expression is a starting path. Everything after it is tested, printed, or acted upon for each entry below those paths. If you omit a starting path in a script or shell alias, you can accidentally search an unintended location, so make the path explicit.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Start with a path, then add a name test
find . -name 'report.pdf'
This searches below the current directory (.) for entries whose name matches report.pdf. A leading slash searches from the filesystem root, while a home directory or project path narrows the work:
find /home/alex/Documents -name 'report.pdf'
find /var/log -name '*.log'
Quote wildcard patterns. Without quotes, the shell may expand *.log against names in your current directory before find receives the expression. The quoted form passes the pattern unchanged so find applies it at every level of the search.
Match without regard to capitalization
find /home -iname '*.jpg'
-iname performs a case-insensitive name match, so extensions such as .jpg, .JPG, and mixed-case variants can match. Use -name when capitalization is meaningful.
Restrict matches by object type
find /var/log -type f -name '*.log'
find /tmp -type d -name 'cache*'
-type f limits results to regular files; -type d limits them to directories. Filtering the type before a broad name pattern prevents a directory or another filesystem object from appearing in a result intended for files.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesFilter by size and modification time
find /data -type f -size +100M
find /var/log -type f -mtime -1
The first command selects regular files larger than 100 MiB units as interpreted by GNU find‘s size syntax. The second selects regular files whose modification time is within the previous day-count period. These tests are evaluated against current metadata, so they are useful for finding large files or recently changed logs without first knowing their names.
Rank #2
- WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
- AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
- PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
- ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
- COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
For a reproducible boundary, use the more specific time predicates available in your implementation, such as minute-based tests, and read man find for the exact rounding rules. Do not infer that “one day” means exactly 24 hours in every form of the command: day-based predicates count complete 24-hour periods according to find‘s documented behavior.
Combine conditions deliberately
find evaluates expressions from left to right, with operator precedence. A mixed expression using -o (OR) and the implicit or explicit -a (AND) can therefore match more entries than intended. Group alternatives with escaped or quoted parentheses:
find /srv -type f ( -name '*.log' -o -name '*.out' ) -size +10M -print
Here, the type test applies to both filename alternatives, and the size test applies after the grouped name expression. The backslashes keep the shell from treating the parentheses as shell syntax. You can also quote the parentheses, for example '(' and ')', when that is clearer in a script.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Search more than one starting tree
find /etc /usr/local/etc -type f -name '*.conf'
Each starting point is traversed. This is often clearer and safer than searching from / when you already know the likely locations. A root-level search can cross many directories, mounted filesystems, and permission boundaries, producing a long run and diagnostic messages.
Useful find recipes
Find an exact filename below the current directory
find . -name 'report.pdf'
Use this when the file was created recently or when index freshness matters. It reports the path as it exists during the traversal.
Find files of a particular extension anywhere in a tree
find /projects -type f -iname '*.jpg' -print
The explicit -print makes the output action visible in scripts and in explanations. It is also a useful preview before adding an action that changes files.
List recently modified log files
find /var/log -type f -name '*.log' -mtime -1 -print
This combines a path, object type, name pattern, and modification-age predicate. If the command produces permission diagnostics, keep the search rooted in directories your account can read or address the permissions separately rather than hiding errors automatically.
Rank #3
- Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
- Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
- Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
- ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
- Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
Preview matches before an operation
Do not begin with a destructive action. First run the complete expression with -print and inspect every path:
find /tmp -type f -name '*.tmp' -print
Only after confirming the scope and pattern should you choose an action. For example, GNU find can remove matches with -delete:
find /tmp -type f -name '*.tmp' -delete
Treat that command as irreversible. Recheck the starting path, the type test, and the quoted pattern; never replace a specific path with / or a broad wildcard casually. If you need a program to process each result, -exec supplies the path as an argument:
find /data -type f -name '*.csv' -exec gzip -- '{}' ;
Review the manual for your implementation before using an action in production, and test on a small directory first. An action is evaluated for every match, so an imprecise expression can affect many files.
Free tools Windows power users keep installed
One-click scans. No signup required.
Handle spaces and newlines in filenames
Plain line-oriented output is easy to read but is not a safe interchange format for arbitrary filenames. When handing results to another command, use null-delimited output and a null-aware consumer:
find /data -type f -name '*.csv' -print0 | xargs -0 -r gzip --
This prevents spaces, tabs, and embedded newlines in a filename from being split into separate arguments. Keep the same preview-first discipline when the downstream command changes or removes data.
Use locate for fast indexed name searches
The general form is:
locate [option...] pattern...
A simple query searches the filename database for matching paths:
Rank #4
- Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
- Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
- 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
- Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
- USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
locate 'report.pdf'
Patterns can include shell-style wildcards. GNU documentation gives this capitalization alternative:
locate '*[Mm]akefile'
Quote the pattern so your interactive shell does not expand it before locate interprets it. Depending on the implementation, -b can restrict matching to the basename rather than any part of the full path:
locate -b 'report.pdf'
Because option support varies, verify -b with locate --help or the local manual. A basename query is useful when you want files named exactly report.pdf regardless of their parent directories; an unqualified pattern may also match a directory component containing that text.
Understand what the index contains
locate reads one or more databases generated by updatedb. The database scope is configuration-dependent: some directories may be included, while temporary, virtual, network, or administrator-excluded paths may be omitted. The refresh interval is also system-dependent.
A file created after the last update is not guaranteed to appear. Conversely, a path that was deleted or renamed after the update can remain in the results until the database is refreshed. A blank result therefore does not prove that the file is absent, and a printed path does not prove that it still exists.
When you administer the machine and need the index refreshed, run the system’s updatedb command according to its configuration and privilege requirements. On a shared system, changing update settings can affect every user and may require administrator access. After the update completes, repeat the locate query; if the directory is excluded by policy, refreshing alone will not add it.
Choosing the right command
| Need | Recommended approach | Important qualification |
|---|---|---|
| Find a file created seconds ago | find /likely/path -name 'name' |
Searches live directory entries; permissions and traversal time still apply. |
| Search by size, type, age, ownership, or permissions | find with predicates |
Build and preview the full expression before using an action. |
| Get a quick lead from a partial name | locate 'pattern' |
Only indexed paths are searched, and the index may be stale. |
| Confirm a path before opening, copying, or deleting | Run a matching find query |
The live check avoids trusting an old database entry. |
| Search a huge tree repeatedly for names | Use locate for discovery, then find for validation |
The best choice depends on index coverage and how current the result must be. |
A dependable locate-then-find workflow
- Search broadly by name. Run a quoted
locatepattern, such aslocate '*invoice*', to obtain candidate paths quickly. - Inspect the candidates. Remove results that clearly belong to an old location, an excluded context, or an unexpected directory.
- Verify live existence. Use
findon the relevant parent path with the exact name and any required type test, for examplefind /home/alex -type f -name 'invoice-2026.pdf'. - Add metadata requirements. Include size, age, ownership, or permission predicates if the operation depends on them.
- Preview the final result. Print every path and check the starting point, pattern, and output before invoking
-exec,-delete, or another modifying command.
This division of labor keeps the fast part of discovery separate from the correctness check. It also works when the index is intentionally incomplete: find remains the authoritative choice for the directories you can traverse.
Best Value
- Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
- Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
- Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
- Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
- Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
Troubleshoot common failures
“locate finds nothing, but the file exists.”
- The file may have been created since the last
updatedbrun. - Its directory may be excluded from the database configuration.
- Your pattern may not match the stored path or capitalization.
- The installed implementation may use a different database or option behavior.
Check the path with a targeted find command. If you administer the host, refresh the database and check its configured scope.
“locate prints a path that is gone.”
The index can contain a deleted or renamed path until the next successful update. Confirm it with find or another live filesystem check before opening or modifying it.
“find says permission denied.”
The account running the command cannot read or traverse part of the starting tree. Narrow the starting path to directories you are allowed to inspect, or run the command with the appropriate administrative authorization when policy permits. Suppressing diagnostics can hide directories that were never searched, so do not treat a quiet output as proof of completeness.
“My wildcard matches the wrong things.”
Quote the pattern: use find . -name '*.log', not find . -name *.log. The unquoted form is expanded by the shell in the current directory before find evaluates it.
“An OR expression returns unexpected paths.”
Group alternatives explicitly and include the type or other tests in the intended scope:
find /var -type f ( -name '*.log' -o -name '*.out' ) -mtime -7 -print
Parentheses prevent shell interpretation and make the expression’s precedence clear to both the shell and the reader.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
“The command is too slow.”
Reduce the starting tree first: search /home or a project directory instead of / when that is sufficient. Add a type or name predicate that eliminates irrelevant entries, and avoid traversing mounted or permission-heavy trees unless they are part of the question. For a repeated, name-only lookup where indexed coverage is acceptable, use locate and reserve find for confirmation.
Command reference
| Goal | Command |
|---|---|
| Exact name below the current directory | find . -name 'report.pdf' |
| Case-insensitive image search | find /home -iname '*.jpg' |
| Regular log files | find /var/log -type f -name '*.log' |
| Directories beginning with “cache” | find /tmp -type d -name 'cache*' |
| Regular files larger than 100M | find /data -type f -size +100M |
| Files modified within the recent day-count period | find /var/log -type f -mtime -1 |
| Indexed filename search | locate 'report.pdf' |
| Indexed Makefile search, either capitalization | locate '*[Mm]akefile' |
| Basename match where supported | locate -b 'report.pdf' |
| Refresh the locate database | updatedb |
The essential distinction is simple: find computes an answer from the live trees you specify, while locate retrieves names from a periodically refreshed index. Choose the former for freshness and expressive conditions, the latter for speed and quick name discovery, and combine them when you need both.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




