![linux find file by extension linux find file by extension](https://www.lifewire.com/thmb/ide_UQsjJazOS__-mALAM1xdGj8=/659x382/filters:no_upscale():max_bytes(150000):strip_icc()/AQVG91rlTC-c49eb486429442f992a55f888c1e8dd7.png)
Looks for directories modified within the last 10 days find. This will look for files modified within the last 17 hours find. The -mtime +8 will look for txt files that are older than 8 days. type d –empty Find files by age or modification timeįind files older than n days find /path/ -type f -name '*.txt' -mtime +8 When looking for files within a specific range such as between 100 and 200 MB find / -size +100M -size -200M Look for directories larger than 20kbįind / -type d -size +20k Find empty files and directories.ĭirectories find.
![linux find file by extension linux find file by extension](https://www.tecmint.com/wp-content/uploads/2017/03/lsblk-Shows-Linux-Filesystem-Type.png)
type f -size -10M Find files with sizes between 100-200MB To Search find all 30MB files find / -size 30M Find files larger than a specified size find -size +2M G – Gigabytes Find files of a certain size – equal to 30MB Use the appropriate size format depending on the type of files or directories you are searching for.
![linux find file by extension linux find file by extension](https://www.wikihow.com/images/5/58/690519-16-1.jpg)
You can find all files or directories that are smaller, equal or greater than a certain size, within a certain range or empty. The general syntax for the find command is find Įxplore more grep command examples.
#LINUX FIND FILE BY EXTENSION HOW TO#
We will then show you how to use the -exec option to act on the files or directories based on their size, permissions, etc. This will show you how to find files and directories. In this article, we will start by explaining the basic Linux find commands with examples. Adding the -exec option enables sysadmins to run external commands and perform actions like copying, moving, deleting, or changing permissions of the files matching the specified criteria such as size, name, etc. It can find directories and files by their name, their type, or extension, size, permissions, etc.īesides locating files and directories, combining the find command with others enables you to take action on the results. The Linux find command is a powerful tool that enables system administrators to locate and manage files and directories based on a wide range of search criteria.