<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://dikapediav2.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Find</id>
	<title>Find - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://dikapediav2.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Find"/>
	<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Find&amp;action=history"/>
	<updated>2026-04-11T05:35:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Find&amp;diff=77&amp;oldid=prev</id>
		<title>Ardika Sulistija: Created page with &quot;&lt;B&gt;find&lt;/B&gt; - Search for files in a directory hierarchy.  ----   Examples:  find /dir -name &quot;filename&quot;       # Searches up the &quot;dir&quot; directory with &quot;filename&quot;  find /dir -iname &quot;filename&quot;      # ^^^ does the same but insensitive.  find /dir -emtpy                 # Searches up all the empty files in &quot;dir&quot; directory.    Displays the 5 LARGEST files in the directory THAT YOU ARE IN. (hence the dot (.)  find . -type f -exec ls -s {} \; | sprt -n -r | head -5    Displays the...&quot;</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Find&amp;diff=77&amp;oldid=prev"/>
		<updated>2024-08-27T00:15:27Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;B&amp;gt;find&amp;lt;/B&amp;gt; - Search for files in a directory hierarchy.  ----   Examples:  find /dir -name &amp;quot;filename&amp;quot;       # Searches up the &amp;quot;dir&amp;quot; directory with &amp;quot;filename&amp;quot;  find /dir -iname &amp;quot;filename&amp;quot;      # ^^^ does the same but insensitive.  find /dir -emtpy                 # Searches up all the empty files in &amp;quot;dir&amp;quot; directory.    Displays the 5 LARGEST files in the directory THAT YOU ARE IN. (hence the dot (.)  find . -type f -exec ls -s {} \; | sprt -n -r | head -5    Displays the...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;B&amp;gt;find&amp;lt;/B&amp;gt; - Search for files in a directory hierarchy.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
 find /dir -name &amp;quot;filename&amp;quot;       # Searches up the &amp;quot;dir&amp;quot; directory with &amp;quot;filename&amp;quot;&lt;br /&gt;
 find /dir -iname &amp;quot;filename&amp;quot;      # ^^^ does the same but insensitive.&lt;br /&gt;
 find /dir -emtpy                 # Searches up all the empty files in &amp;quot;dir&amp;quot; directory. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Displays the 5 LARGEST files in the directory THAT YOU ARE IN. (hence the dot (.)&lt;br /&gt;
 find . -type f -exec ls -s {} \; | sprt -n -r | head -5 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Displays the 5 SMALLEST files in the directory THAT YOU ARE IN (hence the dot (.))&lt;br /&gt;
 find . -type f -exec ls -s {} \; | sprt -n | head -5 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other useful commands:&lt;br /&gt;
 find /dir -type d                # Searches all directories in the &amp;quot;dir&amp;quot; directory.&lt;br /&gt;
 find /dir -type f                # Searches all files in the &amp;quot;dir&amp;quot; directory&lt;br /&gt;
 find /dir -type f -name &amp;quot;.*&amp;quot;     # Displays HIDDEN FILES in &amp;quot;dir&amp;quot; directory&lt;br /&gt;
 find /dir -type d -name &amp;quot;.*&amp;quot;     # Displays HIDDEN directories in &amp;quot;dir&amp;quot; directory&lt;br /&gt;
 find /dir -size +1M              # Displays all files that 1 Megabyte or larger&lt;br /&gt;
 find /dir -size 2m               # Displays all files that are exactly 2 Megabytes&lt;br /&gt;
 find /dir - size -1M             # Displays all files that are less than 1 MB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To go through a directory, and add a &amp;quot;index.html&amp;quot; file into every other directory within that specific directory: https://askubuntu.com/questions/1051401/how-to-add-empty-index-html-from-each-folder-and-subfolder&lt;br /&gt;
* This will find all directories (-type d) and for each, execute the command touch {}/index.html where {} is replaced by the path name of the directory. touch creates a file if it doesn&amp;#039;t exist; if it does, touch does nothing.&lt;br /&gt;
* The \; at the end signifies the end of the touch command.&lt;br /&gt;
* Just replace top/level/directory by the proper path name for your web site.&lt;br /&gt;
 find top/level/directory -type d -exec touch {}/index.html \;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Using the Find command to change permissions recursively====&lt;br /&gt;
----&lt;br /&gt;
This changes the permissions of the files within the &amp;lt;b&amp;gt;DocNav&amp;lt;/b&amp;gt; directory based on whether they are executables or not. &lt;br /&gt;
 LOCDIR=DocNav; dzdo find ./${LOCDIR} -perm /u=x -exec chmod a+x {} \; &amp;amp;&amp;amp; dzdo chmod -R a+r ./$LOCDIR&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
</feed>