<?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: Using the find command to find all executable files. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547990#M875565</link>
    <description>Just to add to Michael's answer, you can add the '-type f' switch to remove directories/symlinks from the output :&lt;BR /&gt;&lt;BR /&gt;find / -type f -perm -555&lt;BR /&gt;</description>
    <pubDate>Tue, 03 Jul 2001 06:19:40 GMT</pubDate>
    <dc:creator>Laurent Paumier</dc:creator>
    <dc:date>2001-07-03T06:19:40Z</dc:date>
    <item>
      <title>Using the find command to find all executable files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547986#M875561</link>
      <description>I'm trying to get a listing of all the executable files on our servers.  Does anyone know what the command would be to do this?  Is the find command the best way to do it?&lt;BR /&gt;&lt;BR /&gt;Your help will be appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks, &lt;BR /&gt;&lt;BR /&gt;Jo</description>
      <pubDate>Tue, 03 Jul 2001 03:17:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547986#M875561</guid>
      <dc:creator>Joanne Keegan</dc:creator>
      <dc:date>2001-07-03T03:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using the find command to find all executable files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547987#M875562</link>
      <description>Hi Jo, &lt;BR /&gt;&lt;BR /&gt;You can use the find command.&lt;BR /&gt;&lt;BR /&gt;A simple command as below will find files&lt;BR /&gt;that all have permissions as 555&lt;BR /&gt;&lt;BR /&gt;# find /opt -perm -555 | tee /tmp/file.out&lt;BR /&gt;&lt;BR /&gt;Of course you can make them more complex if&lt;BR /&gt;you wish, but here is one to get you started.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Michael</description>
      <pubDate>Tue, 03 Jul 2001 03:46:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547987#M875562</guid>
      <dc:creator>Michael Tully</dc:creator>
      <dc:date>2001-07-03T03:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using the find command to find all executable files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547988#M875563</link>
      <description>&lt;BR /&gt;  Hi&lt;BR /&gt;&lt;BR /&gt;  This script U can use for finding out the executables in ur server.&lt;BR /&gt;&lt;BR /&gt;cd /&lt;BR /&gt;for i in `find .`&lt;BR /&gt;do&lt;BR /&gt;if test -x $i &amp;amp;&amp;amp; test -f $i&lt;BR /&gt;then&lt;BR /&gt;ls &amp;gt;&amp;gt; /tmp/exelist&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;   I hope this will full fill ur requirement.&lt;BR /&gt;&lt;BR /&gt;Shahul&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Jul 2001 03:55:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547988#M875563</guid>
      <dc:creator>Shahul</dc:creator>
      <dc:date>2001-07-03T03:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using the find command to find all executable files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547989#M875564</link>
      <description>&lt;BR /&gt;  Hi&lt;BR /&gt;&lt;BR /&gt;   Now all executables will be listed in /tmp/exelist.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Shahul</description>
      <pubDate>Tue, 03 Jul 2001 03:58:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547989#M875564</guid>
      <dc:creator>Shahul</dc:creator>
      <dc:date>2001-07-03T03:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using the find command to find all executable files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547990#M875565</link>
      <description>Just to add to Michael's answer, you can add the '-type f' switch to remove directories/symlinks from the output :&lt;BR /&gt;&lt;BR /&gt;find / -type f -perm -555&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Jul 2001 06:19:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547990#M875565</guid>
      <dc:creator>Laurent Paumier</dc:creator>
      <dc:date>2001-07-03T06:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using the find command to find all executable files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547991#M875566</link>
      <description>find / -perm -555 -print</description>
      <pubDate>Tue, 03 Jul 2001 06:28:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547991#M875566</guid>
      <dc:creator>Ravi_8</dc:creator>
      <dc:date>2001-07-03T06:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using the find command to find all executable files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547992#M875567</link>
      <description>Hi Joanne,&lt;BR /&gt;&lt;BR /&gt;The following script do what you need :&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;rm /tmp/executableFiles.log &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;allFiles=`find / -name "*" -print`&lt;BR /&gt;for currentFile in $allFiles&lt;BR /&gt;do&lt;BR /&gt;   isExecutable=`file $currentFile ? grep executable`&lt;BR /&gt;   if [[ $isExecutable != "" ]]&lt;BR /&gt;   then&lt;BR /&gt;       echo $currentFile &amp;gt;&amp;gt; /tmp/executableFiles.log&lt;BR /&gt;   fi&lt;BR /&gt;done</description>
      <pubDate>Tue, 03 Jul 2001 06:55:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547992#M875567</guid>
      <dc:creator>Magdi KAMAL</dc:creator>
      <dc:date>2001-07-03T06:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using the find command to find all executable files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547993#M875568</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;find . -type f -exec test -x {} \; -print</description>
      <pubDate>Tue, 03 Jul 2001 08:07:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547993#M875568</guid>
      <dc:creator>Klaus Crusius</dc:creator>
      <dc:date>2001-07-03T08:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using the find command to find all executable files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547994#M875569</link>
      <description>Hi Joanne:&lt;BR /&gt;&lt;BR /&gt;If you want to traverse all direcories on your server looking for executable permissions, regardless of other permission bits, do this:&lt;BR /&gt; &lt;BR /&gt;# find / -xdev -type f \( -perm -u=x -o -perm -g=x -o -perm -o=x \)&lt;BR /&gt;&lt;BR /&gt;This search returns only files (not directories, etc.) and will not cross mountpoints.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 03 Jul 2001 10:56:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547994#M875569</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-07-03T10:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using the find command to find all executable files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547995#M875570</link>
      <description>Joanne,&lt;BR /&gt;&lt;BR /&gt;I like JRF's answer.  &lt;BR /&gt;&lt;BR /&gt;On the other hand, if you want a list of all executable files, regardless of their permissions, you can try something like:&lt;BR /&gt;&lt;BR /&gt;find / -type f | while read -r file&lt;BR /&gt;do&lt;BR /&gt;   file "$line"&lt;BR /&gt;done | grep -e exec -e commands&lt;BR /&gt;&lt;BR /&gt;If you want to capture other types of files, you can&lt;BR /&gt;omit the grep part, save the output (it will contain a list&lt;BR /&gt;of all files on your system) to a file, then view the output and decide what types of files you would like to have extracted from this list (by using grep, etc).&lt;BR /&gt;&lt;BR /&gt;My point is that there may be executables that have&lt;BR /&gt;no "execute" permission set.  You may also have plain data files with 777 permission (so you won't be able to "run" them).  Then, you can have scripts with read&lt;BR /&gt;only permission, but one can execute them via "sh", etc.&lt;BR /&gt;&lt;BR /&gt;I guess the answer to your question depends on what you really want to do.  I hope this helps a bit.&lt;BR /&gt;&lt;BR /&gt;Mladen&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Jul 2001 18:23:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547995#M875570</guid>
      <dc:creator>Mladen Despic</dc:creator>
      <dc:date>2001-07-03T18:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using the find command to find all executable files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547996#M875571</link>
      <description>Correction - this little script:&lt;BR /&gt;&lt;BR /&gt;find / -type f | while read -r file &lt;BR /&gt;do &lt;BR /&gt;    file "$line" &lt;BR /&gt;done | grep -e exec -e commands &lt;BR /&gt;&lt;BR /&gt;is supposed to be:&lt;BR /&gt;&lt;BR /&gt;find / -type f | while read -r file &lt;BR /&gt;do &lt;BR /&gt;file "$file" &lt;BR /&gt;done | grep -e exec -e commands</description>
      <pubDate>Tue, 03 Jul 2001 18:26:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547996#M875571</guid>
      <dc:creator>Mladen Despic</dc:creator>
      <dc:date>2001-07-03T18:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using the find command to find all executable files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547997#M875572</link>
      <description>Thanks to all that replied.  I really appreciate your help.&lt;BR /&gt;&lt;BR /&gt;Jo</description>
      <pubDate>Tue, 03 Jul 2001 21:04:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547997#M875572</guid>
      <dc:creator>Joanne Keegan</dc:creator>
      <dc:date>2001-07-03T21:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using the find command to find all executable files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547998#M875573</link>
      <description>The command&lt;BR /&gt;&lt;BR /&gt;find / -type f -perm +111&lt;BR /&gt;&lt;BR /&gt;will find all files with any executeable bits set.  If you&lt;BR /&gt;are runing samba this will include most files on your&lt;BR /&gt;shares.  You will may miss some scripts that are run&lt;BR /&gt;by passing them as arguments to commands &lt;BR /&gt;like sh, perl, and awk as they don't need the &lt;BR /&gt;execute permission bit set.</description>
      <pubDate>Wed, 04 Jul 2001 01:26:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-the-find-command-to-find-all-executable-files/m-p/2547998#M875573</guid>
      <dc:creator>Bill Thorsteinson</dc:creator>
      <dc:date>2001-07-04T01:26:40Z</dc:date>
    </item>
  </channel>
</rss>

