<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: find in root in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987561#M95869</link>
    <description>If you nevertheless must run find over a large portion of your system'm filetree then I suggest a Plan B:&lt;BR /&gt;&lt;BR /&gt;1) Run find once and write the output to a temporary file - preferably with filters to restrict it to specific filesystems and to restrict it to regular files.&lt;BR /&gt;2) Scan this list of files using grep to find the matches.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 24 Apr 2007 09:20:17 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2007-04-24T09:20:17Z</dc:date>
    <item>
      <title>find in root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987554#M95862</link>
      <description>hi,&lt;BR /&gt;     I have a file which contains a list of filenames which i have to search in the whole filesystem (root /). I have used a script like&lt;BR /&gt;cat file|while read FILENAME&lt;BR /&gt;do&lt;BR /&gt;find / -name $FILENAME&lt;BR /&gt;done&lt;BR /&gt;But this is running damn slowly and i fear it may take years to complete this command. &lt;BR /&gt;Any one help me out plzzz</description>
      <pubDate>Tue, 24 Apr 2007 06:14:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987554#M95862</guid>
      <dc:creator>Reen</dc:creator>
      <dc:date>2007-04-24T06:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: find in root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987555#M95863</link>
      <description>Hi Reen@&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;What about:&lt;BR /&gt;&lt;BR /&gt;# find / -xdev | grep  -f file&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;rgds&lt;BR /&gt;HGH</description>
      <pubDate>Tue, 24 Apr 2007 06:24:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987555#M95863</guid>
      <dc:creator>Hemmetter</dc:creator>
      <dc:date>2007-04-24T06:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: find in root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987556#M95864</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;find / -xdev -name $FILENAME</description>
      <pubDate>Tue, 24 Apr 2007 06:34:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987556#M95864</guid>
      <dc:creator>Luk Vandenbussche</dc:creator>
      <dc:date>2007-04-24T06:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: find in root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987557#M95865</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;find / -xdev -type f -name $FILENAME&lt;BR /&gt;&lt;BR /&gt;(type f will only look for normal files)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 24 Apr 2007 06:43:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987557#M95865</guid>
      <dc:creator>Rasheed Tamton</dc:creator>
      <dc:date>2007-04-24T06:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: find in root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987558#M95866</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;If you truly mean the whole file system, visting every mountpoint, then:&lt;BR /&gt;&lt;BR /&gt;# find / -type f -name ...&lt;BR /&gt;&lt;BR /&gt;...will do that AND potentially take a long time.  &lt;BR /&gt;&lt;BR /&gt;If you don't want to visit mountpoints then add the '-xdev' switch as noted:&lt;BR /&gt;&lt;BR /&gt;# find / -xdev -type f -name ...&lt;BR /&gt;&lt;BR /&gt;Notice that in either case I specified only *files* with the '-type f' argument.  Drop that if you truly want both files and directories.&lt;BR /&gt;&lt;BR /&gt;Lastly you can reduce the number of searches by doing something like:&lt;BR /&gt;&lt;BR /&gt;# find / -xdev -type f -name myfile -o -name yourfile -o -name "her*" -o -name "his*"&lt;BR /&gt;&lt;BR /&gt;That is, look for files by individual name and perhaps using wildcards.  Be sure to quote the metacharacters so that the shell doesn't interpret them.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 24 Apr 2007 06:44:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987558#M95866</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-04-24T06:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: find in root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987559#M95867</link>
      <description>hi Reena,&lt;BR /&gt;&lt;BR /&gt;You may also consider breaking you code into several parts so that you can launch them in parallel.&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Tue, 24 Apr 2007 07:56:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987559#M95867</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2007-04-24T07:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: find in root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987560#M95868</link>
      <description>NEVER, EVER run find on the root directory for a production machine. Of course it will be slow -- you are examining every directory including CDROMs, network filesystems, database files, etc, etc. Why would you look for a file like that? If a user can't find their file, there are VERY few places where the user can create a file, namely: $HOME /var/tmp and /tmp, so your command changes to:&lt;BR /&gt; &lt;BR /&gt;find /home/some_user /var/tmp /tmp -name $FILENAME&lt;BR /&gt; &lt;BR /&gt;If you are looking for a particular command, start with the man pages, then look in the system directories and application directories:&lt;BR /&gt; &lt;BR /&gt;find /usr/bin /usr/sbin /use/lbin /usr/local /usr/contrib /opt/*/bin -name $FILENAME&lt;BR /&gt; &lt;BR /&gt;A typical HP-UX system installation has several thousand files in several hundred directories, most of which you never need to search. &lt;BR /&gt; &lt;BR /&gt;Is there a reason you need to look in every directory in the entire machine?</description>
      <pubDate>Tue, 24 Apr 2007 08:20:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987560#M95868</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2007-04-24T08:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: find in root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987561#M95869</link>
      <description>If you nevertheless must run find over a large portion of your system'm filetree then I suggest a Plan B:&lt;BR /&gt;&lt;BR /&gt;1) Run find once and write the output to a temporary file - preferably with filters to restrict it to specific filesystems and to restrict it to regular files.&lt;BR /&gt;2) Scan this list of files using grep to find the matches.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 24 Apr 2007 09:20:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987561#M95869</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-04-24T09:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: find in root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987562#M95870</link>
      <description>Its not tat i want to search in root. I just gave an example. Cos the directory am searching in has many subdirectiories and it is taking lot of time in searching for all the files in all these directories.. any faster way of searching?</description>
      <pubDate>Wed, 25 Apr 2007 21:47:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987562#M95870</guid>
      <dc:creator>Reen</dc:creator>
      <dc:date>2007-04-25T21:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: find in root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987563#M95871</link>
      <description>Look for ways to narrow down your search for ex. search only 3 filesystems out of however many are present on the server or the filenames have a common extension "*.c" or run the command when the system is under minimal load.&lt;BR /&gt;&lt;BR /&gt;~hope it helps</description>
      <pubDate>Wed, 25 Apr 2007 22:29:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987563#M95871</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-04-25T22:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: find in root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987564#M95872</link>
      <description>&lt;P&gt;&amp;gt;any faster way of searching?&lt;BR /&gt;&lt;BR /&gt;As HGH, JRF and Clay (Plan B) have suggested, you want to do one find, then grep with your list of files. Your original while/find would do N finds.&lt;BR /&gt;&lt;BR /&gt;One advantage of Plan B is that you can look for a filename that wasn't in your "file".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; find / -xdev -type f -name myfile -o -name yourfile -o -name "her*" -o -name "his*"﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are going to mix AND with OR, you need to use ():&lt;/P&gt;&lt;P&gt;# find / -xdev -type f \( -name myfile -o -name yourfile -o -name "her*" -o -name "his*"﻿ \)&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2011 03:14:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987564#M95872</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-10-06T03:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: find in root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987565#M95873</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You can add -type f  (type is file, -d dir, etc.)&lt;BR /&gt;(find / -type f -name $FILENAME)&lt;BR /&gt;or even add -mtime -12 (within the last 12 days) or +12 (12 + days)&lt;BR /&gt;(find . -type f -mtime -1300  -name $FILENAME)&lt;BR /&gt;&lt;BR /&gt;to make it faster the search operation.&lt;BR /&gt;Also see the -atime, -mtime and -user (owner of the file, etc to make your search faster.&lt;BR /&gt;&lt;BR /&gt;See man find&lt;BR /&gt;&lt;BR /&gt;Rasheed Tamton.</description>
      <pubDate>Sat, 28 Apr 2007 02:49:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987565#M95873</guid>
      <dc:creator>Rasheed Tamton</dc:creator>
      <dc:date>2007-04-28T02:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: find in root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987566#M95874</link>
      <description>&amp;gt; [...] i have to search in the whole&lt;BR /&gt;&amp;gt; filesystem (root /).&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Its not tat i want to search in root. I&lt;BR /&gt;&amp;gt; just gave an example.&lt;BR /&gt;&lt;BR /&gt;Sometimes it's helpful to ask the question&lt;BR /&gt;for which you actually want the answer.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; cat file|while read FILENAME&lt;BR /&gt;&lt;BR /&gt;Knowing, even approximately, what is in&lt;BR /&gt;"file" might also be helpful in deciding&lt;BR /&gt;which of the techniques already suggested&lt;BR /&gt;would be good or bad.</description>
      <pubDate>Sat, 28 Apr 2007 07:18:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-in-root/m-p/3987566#M95874</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-04-28T07:18:14Z</dc:date>
    </item>
  </channel>
</rss>

