All tags
find
Narrow down
Other tips34
- Tip
find / -maxdepth 1 -fstype procfind -fstype matches files by the type of filesystem they live onSelects files that sit on a given filesystem type, and -printf %F shows which type that is.3 Dec 2026 - Tip
find /srv/downloads -type f -size +100M -size -1G -exec ls -lh {} +Two find -size tests give you a size rangeLists files between two sizes, for example everything between 100 MB and 1 GB.30 Nov 2026 - Tip
find /srv -xdev -samefile /srv/downloads/movie.mkvfind -samefile lists every hard link to the same fileShows all the names a file has on disk, so you know what still keeps it alive.30 Nov 2026 - Tip
find / -xdev -user olduser -ls 2>/dev/nullfind -user lists everything one account ownsLists the files that belong to one user, for a cleanup or before you remove the account.30 Nov 2026 - Tip
find /srv/archive \( -name '*.txt' -fprint txt.list \) -o \( -name '*.gz' -fprint gz.list \)find -fprint writes several result lists in one passSorts search results into separate files without walking the folder tree twice.30 Nov 2026 - Tip
find / -xdev -lname '/mnt/olddisk/*' -ls 2>/dev/nullfind -lname finds symlinks by where they pointLists the symbolic links that point to a certain path, for example before you move a folder.30 Nov 2026 - Tip
find /srv -maxdepth 1 -type d,lfind -type d,l matches several file types in one testLists folders and symlinks together without writing two type tests joined with -o.30 Nov 2026 - Tip
find /srv/app -name '*.log' -mtime +30 -exec mv -t /srv/old-logs {} +find -exec mv -t moves many files with one mv commandMoves all the files find selects into one folder with a handful of mv calls instead of one per file.30 Nov 2026 - Tip
find /etc /var/www -ctime -1 -lsfind -ctime catches permission changes that find -mtime missesFinds files whose owner or permissions changed recently, even when their content did not.30 Nov 2026 - Tip
find . -name '*.txt' -exec sh -c 'for f; do cp -- "$f" "${f%.txt}.bak"; done' sh {} +find -exec sh -c lets each file go through a small scriptRuns a few commands per file from find, with the file name passed safely.30 Nov 2026 - Tip
find . -name '*.txt' -o -name '*.log' -printfind -o needs parentheses, or -print only applies to the last nameExplains why find with two -name tests and -print shows only one kind of file.30 Nov 2026 - Tip
find /var -xdev -type f -printf '%h\n' | sort | uniq -c | sort -rn | headfind -printf '%h' counts files per folderShows which folders hold the most files, for finding the place with a million cache files.30 Nov 2026 - Tip
find ~/bin /usr/local/bin -type f -executablefind -executable checks whether you can run a file, not only the x bitLists the files the current user can actually execute, instead of guessing from permission bits.30 Nov 2026 - Tip
find /var/log/app -daystart -type f -mtime 0 # changed todayfind -daystart makes -mtime count calendar days instead of 24 hoursMakes find's day tests start at midnight, so yesterday means yesterday on the calendar.30 Nov 2026 - Tip
find -L /srv/media -name '*.mkv'find -L follows symlinked folders that find normally skipsMakes find search inside folders that are reached through symbolic links.30 Nov 2026 - Tip
find /srv/share -type f -atime +365find -atime is often wrong, because Linux barely updates access timesShows why searching for files nobody read lately with find gives misleading results.30 Nov 2026 - Tip
find -files0-from dirs.list -name '*.log'find -files0-from reads the folders to search from a fileFeeds a long list of starting folders to find from a file instead of the command line.30 Nov 2026 - Tip
find . -type f -size -1024kfind -size -1M only finds empty files, because find rounds sizes upExplains why small files go missing from a find -size search, and how to fix it.30 Nov 2026 - Tip
find: possible unquoted pattern after predicate `-name'?Quote the pattern after find -name, or the shell changes it firstPrevents the shell from expanding a wildcard before find gets to see it.30 Nov 2026 - Tip
find /srv/site -type f -printf '%P\n'find -printf '%P' prints paths without the starting folderGives you paths relative to the folder you searched, ready for another command.30 Nov 2026 - Tip
ls -iFind -inum deletes a file whose name you can't typeRemoves a file with a strange name by its inode number instead of its name.30 Nov 2026 - Tip
find /mnt/user/downloads -name '*.zip' -execdir unzip -n {} \;find -execdir runs a command inside the folder where each file livesRuns a command from the folder of each matched file, so output lands next to it.27 Nov 2026 - Tip
find /mnt/user/photos -iname '*.jpg'find -iname matches file names whatever their upper and lower caseFinds files by name while ignoring upper and lower case, so .JPG and .jpg both match.27 Nov 2026 - Tip
find ~/Downloads -name '*.iso' -ok rm {} \;find -ok asks before it runs a command on each fileAsks for a yes or no before find runs a command such as rm on each file.27 Nov 2026 - Tip
find . -name '*.tmp' -deletePut -delete last in find, or it deletes more than you thinkDeletes the files that match your tests, as long as -delete comes last in the command.19 Aug 2026 - Tip
find . -name '*.tmp' -print0 | xargs -0 rm --find -print0 | xargs -0 survives file names with spacesPasses file names between find and xargs safely, even with spaces or quotes in them.8 Aug 2026 - Tip
find /var/www -perm /o+w ! -type lfind -perm /o+w lists files that anyone can write toLists files and folders in which the others class has write access.20 May 2026 - Tip
find . -name node_modules -prune -o -type f -name '*.js' -printfind -name node_modules -prune skips a folder instead of walking itSkips a whole directory tree during a search, such as a dependency folder.19 May 2026 - Tip
find /etc -type f -mmin -30find -mmin -30 lists the files that changed in the last half hourLists the files that were modified within the last number of minutes.19 May 2026 - Tip
find /srv /etc -xtype l -lsfind -xtype l lists symlinks that point to nothingLists symbolic links whose target no longer exists.21 Feb 2026 - Tip
find . -regextype posix-extended -iregex '.*\.(jpe?g|png|gif)$'find -regextype posix-extended -regex matches several names in one testMatches file paths with one regular expression instead of several -name tests.19 Feb 2026 - Tip
find /etc -maxdepth 1 -type f -name '*.conf'find -maxdepth 1 searches one folder without going into the subfoldersLimits how many directory levels find goes down.19 Feb 2026 - Tip
find . -mindepth 1 -type d -emptyfind -type d -empty lists the folders with nothing in themLists empty files and empty directories under a path.18 Feb 2026 - Tip
find /srv -type f -printf '%s\t%p\n' | sort -nr | head -n 10find -printf with sort shows the biggest files without using lsPrints byte sizes and paths so you can sort and find the largest files.18 Feb 2026
Storage5
- Tip
find /backup -name '*.gz' ! -exec gzip -t {} \; -print 2>/dev/nullfind ! -exec gzip -t lists the archives that are brokenUses a command's exit status inside find to keep only the files that fail a check.30 Nov 2026 - Tip
find /srv/data -depth -printfind -depth lists a folder's contents before the folder itselfChanges find's order so files come before their folder, which some copy and delete jobs need.30 Nov 2026 - Tip
find . -type f -newermt '2026-11-01' ! -newermt '2026-11-08'find -newermt gives you the files changed between two datesLists the files modified inside a date range, without a reference file.17 Feb 2026 - Tip
find /etc -type f -newer /tmp/before-upgradefind -newer lists everything changed since a reference fileLists the files modified after the moment of a reference file.16 Feb 2026 - Tip
find /backup -type f -mtime +7 -printfind -mtime +7 means at least eight days old, because fractions are droppedExplains how find rounds ages in days and how to get a finer cut-off in minutes.16 Feb 2026
Shell5
- Tip
sudo apt install plocatePlocate finds a file by name in milliseconds, from an indexLooks up files by name in a prebuilt index instead of walking the whole disk.27 Nov 2026 - Tip
find . -name '*.py' -exec grep -l 'TODO' {} +find -exec grep -l {} + runs one command for many files instead of one eachRuns a command on batches of matched files instead of once per file.20 May 2026 - Tip
sudo find / -xdev \( -nouser -o -nogroup \) -ls 2>/dev/nullFind -nouser -o -nogroup lists files whose owner no longer existsLists files that belong to a user or group id nobody uses.20 May 2026 - Tip
sudo find / -xdev -type f -perm -4000 2>/dev/nullFind -perm -4000 lists every setuid program on the systemLists every file that runs with the rights of its owner.20 May 2026 - Tip
sudo find / -xdev -type f -size +500M -exec ls -lh {} +Find -size +500M -xdev lists big files on one filesystem onlyLists large files on one filesystem so you can see what is filling it.18 Feb 2026
Docker1
Git1
Nothing matches.