<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://k2.ixota.com/index.php?action=history&amp;feed=atom&amp;title=Linux%2Ffind</id>
	<title>Linux/find - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://k2.ixota.com/index.php?action=history&amp;feed=atom&amp;title=Linux%2Ffind"/>
	<link rel="alternate" type="text/html" href="https://k2.ixota.com/index.php?title=Linux/find&amp;action=history"/>
	<updated>2026-06-26T11:04:09Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.1</generator>
	<entry>
		<id>https://k2.ixota.com/index.php?title=Linux/find&amp;diff=5168&amp;oldid=prev</id>
		<title>Kenneth: /* Delete files older than n days */</title>
		<link rel="alternate" type="text/html" href="https://k2.ixota.com/index.php?title=Linux/find&amp;diff=5168&amp;oldid=prev"/>
		<updated>2019-05-06T20:19:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Delete files older than n days&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== find ==&lt;br /&gt;
&lt;br /&gt;
Find file syntax:&lt;br /&gt;
 find [path] [expression]&lt;br /&gt;
 # case sensitive&lt;br /&gt;
 find [path] -name [pattern]&lt;br /&gt;
 # case insensitive&lt;br /&gt;
 find [path] -iname [pattern]&lt;br /&gt;
 &lt;br /&gt;
 find . -iname &amp;quot;test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
man find:&lt;br /&gt;
       -mtime n&lt;br /&gt;
              File’s data was last modified n*24 hours ago.  See the comments for -atime to  understand  how&lt;br /&gt;
              rounding affects the interpretation of file modification times.&lt;br /&gt;
&lt;br /&gt;
Time modifier:&lt;br /&gt;
 +n     for greater than n,&lt;br /&gt;
 -n     for less than n,&lt;br /&gt;
 n      for exactly n.&lt;br /&gt;
&lt;br /&gt;
Find all files modified within the last &amp;#039;n&amp;#039; days:&lt;br /&gt;
 find [path] -mtime [+//-][n]&lt;br /&gt;
 &lt;br /&gt;
 # to find all files modified today:&lt;br /&gt;
 find /etc -mtime -1&lt;br /&gt;
&lt;br /&gt;
Find all files modified within the last &amp;#039;n&amp;#039; minutes:&lt;br /&gt;
 find [path] -mmin [+//-][n]&lt;br /&gt;
 &lt;br /&gt;
 # to find all files modified within the last hour:&lt;br /&gt;
 find /etc -mmin -60&lt;br /&gt;
&lt;br /&gt;
Filter (exclude) certain folders:&lt;br /&gt;
 find . -type d -not -path &amp;quot;./badpath/*&amp;quot; -not &amp;quot;./badpath2/*&amp;quot; -print&lt;br /&gt;
&lt;br /&gt;
Find files between two dates: [https://askubuntu.com/questions/191044/how-to-find-files-between-two-dates-using-find]&lt;br /&gt;
 find Your_Mail_Dir/ -newermt &amp;quot;2011-01-01&amp;quot; ! -newermt &amp;quot;2011-12-31&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== find large files ==&lt;br /&gt;
&lt;br /&gt;
find files larger than 100M:&lt;br /&gt;
&lt;br /&gt;
 # RHEL&lt;br /&gt;
 find / -type f -size +100M -not -path &amp;quot;/proc/*&amp;quot; -not -path &amp;quot;/sys/*&amp;quot; -exec ls -lh {} \; | awk &amp;#039;{ print $9 &amp;quot;: &amp;quot; $5 }&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 # Ubuntu&lt;br /&gt;
 find / -type f -size +100M -not -path &amp;quot;/proc/*&amp;quot; -not -path &amp;quot;/sys/*&amp;quot; -exec ls -lh {} \; | awk &amp;#039;{ print $8 &amp;quot;: &amp;quot; $5 }&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== find small files ==&lt;br /&gt;
&lt;br /&gt;
Find files smaller than 500 bytes:&lt;br /&gt;
&lt;br /&gt;
 find ~ -size -500b&lt;br /&gt;
&lt;br /&gt;
== Find Executable Files ==&lt;br /&gt;
&lt;br /&gt;
Files and folders (natural):&lt;br /&gt;
 find &amp;lt;path&amp;gt; -executable&lt;br /&gt;
&lt;br /&gt;
Files only:&lt;br /&gt;
 find &amp;lt;path&amp;gt; -executable -type f&lt;br /&gt;
&lt;br /&gt;
== Delete files older than n days ==&lt;br /&gt;
&lt;br /&gt;
Delete files older than 30 days: [http://www.vionblog.com/linux-delete-files-older-than-x-days/]&lt;br /&gt;
 find /path/to/files/ -type f -name &amp;#039;*.jpg&amp;#039; -mtime +30 -exec rm {} \;&lt;br /&gt;
&lt;br /&gt;
== Files Owned by User ==&lt;br /&gt;
&lt;br /&gt;
Find by user:&lt;br /&gt;
 find /var -user vivek&lt;br /&gt;
&lt;br /&gt;
Find by group:&lt;br /&gt;
 find /home -group ftpusers&lt;br /&gt;
&lt;br /&gt;
== keywords ==&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>Kenneth</name></author>
		
	</entry>
</feed>