<?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: Finding files with specific size in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927156#M110797</link>
    <description>Hi Procura, Will appreciate if you can explain your comments in detail. -Sanjay</description>
    <pubDate>Fri, 14 Mar 2003 14:31:55 GMT</pubDate>
    <dc:creator>Sanjay Verma</dc:creator>
    <dc:date>2003-03-14T14:31:55Z</dc:date>
    <item>
      <title>Finding files with specific size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927148#M110789</link>
      <description>find . -local -size +9999 -print | ls -l&lt;BR /&gt;&lt;BR /&gt;Hi Friends,&lt;BR /&gt;I am using the above command to display the files with the size specified but I am getting the files which are even smaller than the size listed above. Although I've looked into the -size n &amp;amp; c options, but still it doesn't help.&lt;BR /&gt;&lt;BR /&gt;I am trying to search for files with size=84bytes and delete those. Am I missing something somewhere...??</description>
      <pubDate>Fri, 14 Mar 2003 01:58:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927148#M110789</guid>
      <dc:creator>Sanjay Verma</dc:creator>
      <dc:date>2003-03-14T01:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Finding files with specific size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927149#M110790</link>
      <description>&lt;BR /&gt;"...-size +n..." equates to :&lt;BR /&gt;+ : greater than&lt;BR /&gt;n : n blocks of 512 bytes.&lt;BR /&gt;&lt;BR /&gt;"...-size -n..." &lt;BR /&gt;- : less than n blocks.&lt;BR /&gt;&lt;BR /&gt;"...-size n..."&lt;BR /&gt;equal to n blocks.&lt;BR /&gt;&lt;BR /&gt;"...-size +nc..."&lt;BR /&gt;+ : greater than&lt;BR /&gt;nc : characters  (* one char = on byte *)&lt;BR /&gt;&lt;BR /&gt;For "...size=84 bytes and delete..."&lt;BR /&gt;&lt;BR /&gt;cd /dir&lt;BR /&gt;find . -size 84c -exec rm {} \;</description>
      <pubDate>Fri, 14 Mar 2003 03:07:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927149#M110790</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2003-03-14T03:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: Finding files with specific size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927150#M110791</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'm not sure how to find files of an exact size using the 'find' command since it uses blocks for the size.  I did figure out a way to do it using Perl.  There is a Perl utility called find2perl which will take the parameters for a find command and write a little Perl script to do the same thing.  I did that and modified the script to find files of exactly 84 bytes.  I've posted the script as an attachment.&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Fri, 14 Mar 2003 03:09:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927150#M110791</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2003-03-14T03:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Finding files with specific size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927151#M110792</link>
      <description>#find &lt;DIR&gt; -size 84c -exec ll {} \;&lt;BR /&gt;&lt;/DIR&gt;</description>
      <pubDate>Fri, 14 Mar 2003 03:13:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927151#M110792</guid>
      <dc:creator>T G Manikandan</dc:creator>
      <dc:date>2003-03-14T03:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Finding files with specific size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927152#M110793</link>
      <description>Oh, never mind.  I guess I should do a 'man find' sometime.  Duh!    :)&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 14 Mar 2003 03:31:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927152#M110793</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2003-03-14T03:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Finding files with specific size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927153#M110794</link>
      <description>Hi Fred, John &amp;amp; Mainkandan&lt;BR /&gt;That's really great to have good people like you. Yes, I've implemented the same and it's working fine. Still doing some more cosmetic changes in the perl script to suit the needs. &lt;BR /&gt;&lt;BR /&gt;Would you be able to indicate the possibility of merging the 2 commands into 1, i.e., display it first and then delete it?&lt;BR /&gt;find &lt;DIR&gt; -size 84c -exec ll {} \; &lt;BR /&gt;find . -size 84c -exec rm {} \;&lt;/DIR&gt;</description>
      <pubDate>Fri, 14 Mar 2003 03:42:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927153#M110794</guid>
      <dc:creator>Sanjay Verma</dc:creator>
      <dc:date>2003-03-14T03:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: Finding files with specific size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927154#M110795</link>
      <description>you can use this format which will ask for removing files interactively.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#find &lt;DIR&gt; -size 84c -ok rm {} \;&lt;/DIR&gt;</description>
      <pubDate>Fri, 14 Mar 2003 04:41:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927154#M110795</guid>
      <dc:creator>T G Manikandan</dc:creator>
      <dc:date>2003-03-14T04:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Finding files with specific size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927155#M110796</link>
      <description>Though the perl script is OK, it's rather unusable that way. These things are for extending, not for command line use.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# perl -MFile::Find -e'find(sub{-f&amp;amp;&amp;amp;-s==84&amp;amp;&amp;amp;print},".")'&lt;BR /&gt;&lt;BR /&gt;does find all files with size 84, and in a system independant way. Here it is on cygwin:&lt;BR /&gt;&lt;BR /&gt;LT03:/tmp 6 $ ll ????.???&lt;BR /&gt;-rwxrwxrwx+   1 Administ None        32768 Nov  5 21:49 MMC3.tmp*&lt;BR /&gt;-rwxrwxrwx+   1 Administ None        32768 Nov  5 21:49 MMC4.tmp*&lt;BR /&gt;-rwxrwxrwx+   1 Administ None        32768 Nov  5 21:49 MMC5.tmp*&lt;BR /&gt;-rwxrwxrwx+   1 Administ None        10678 Dec  2 16:22 Off2.tmp*&lt;BR /&gt;-rwxrwxrwx+   1 Administ None        11158 Dec  5 07:28 Off3.tmp*&lt;BR /&gt;-rwxrwxrwx+   1 Administ None        13558 Feb 11 18:40 Off4.tmp*&lt;BR /&gt;-rw-rw-rw-    1 lt03     None         1824 Jan 10 15:03 XWin.log&lt;BR /&gt;LT03:/tmp 7 $ perl -MFile::Find -le'find(sub{-f&amp;amp;&amp;amp;-s==1824&amp;amp;&amp;amp;print},".")'&lt;BR /&gt;XWin.log&lt;BR /&gt;LT03:/tmp 8 $&lt;BR /&gt;&lt;BR /&gt;replace the 'print' with any action you like&lt;BR /&gt;&lt;BR /&gt;Enjoy, have FUN! H.Merijn&lt;BR /&gt;</description>
      <pubDate>Fri, 14 Mar 2003 09:32:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927155#M110796</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2003-03-14T09:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: Finding files with specific size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927156#M110797</link>
      <description>Hi Procura, Will appreciate if you can explain your comments in detail. -Sanjay</description>
      <pubDate>Fri, 14 Mar 2003 14:31:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927156#M110797</guid>
      <dc:creator>Sanjay Verma</dc:creator>
      <dc:date>2003-03-14T14:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Finding files with specific size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927157#M110798</link>
      <description># perl -MFile::Find -e'find(sub{-f&amp;amp;&amp;amp;-s==84&amp;amp;&amp;amp;print},".")'&lt;BR /&gt;&lt;BR /&gt;option -M means use module ...&lt;BR /&gt;in this case, I want to use File::Find, a module shipped with the perl5 CORE distribution, giving you system independent 'find' functionality in perl&lt;BR /&gt;use 'man File::Find' to find out more about it&lt;BR /&gt;&lt;BR /&gt;here's the script in verbose mode:&lt;BR /&gt;&lt;BR /&gt;--8&amp;lt;---&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;&lt;BR /&gt;use File::Find;&lt;BR /&gt;&lt;BR /&gt;my @dirs_to_find = (".");&lt;BR /&gt;&lt;BR /&gt;sub action&lt;BR /&gt;{&lt;BR /&gt;-f or return; # only 'files' please, no dir's or pipes&lt;BR /&gt;-s == 84 or return; # Only need files with size 84&lt;BR /&gt;unlink $File::Find::name; # remove the file&lt;BR /&gt;}, @dirs_to_find);&lt;BR /&gt;--&amp;gt;8---&lt;BR /&gt;&lt;BR /&gt;clear?&lt;BR /&gt;&lt;BR /&gt;Enjoy, have FUN! H.Merijn</description>
      <pubDate>Fri, 14 Mar 2003 14:51:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927157#M110798</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2003-03-14T14:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Finding files with specific size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927158#M110799</link>
      <description>uhh, thinko's&lt;BR /&gt;&lt;BR /&gt;Change &lt;BR /&gt;--8&amp;lt;---&lt;BR /&gt;sub action &lt;BR /&gt;{ &lt;BR /&gt;-f or return; # only 'files' please, no dir's or pipes &lt;BR /&gt;-s == 84 or return; # Only need files with size 84 &lt;BR /&gt;unlink $File::Find::name; # remove the file &lt;BR /&gt;}, @dirs_to_find); &lt;BR /&gt;--&amp;gt;8---&lt;BR /&gt;&lt;BR /&gt;to&lt;BR /&gt;&lt;BR /&gt;--8&amp;lt;---&lt;BR /&gt;sub action &lt;BR /&gt;{ &lt;BR /&gt;-f or return; # only 'files' please, no dir's or pipes &lt;BR /&gt;-s == 84 or return; # Only need files with size 84 &lt;BR /&gt;unlink $File::Find::name; # remove the file &lt;BR /&gt;}&lt;BR /&gt;find (\&amp;amp;action, @dirs_to_find); &lt;BR /&gt;--&amp;gt;8---&lt;BR /&gt;&lt;BR /&gt;I'm so used to the 'find (sub{},".")' notation, that I used it :/&lt;BR /&gt;&lt;BR /&gt;Enjoy, have FUN! H.Merijn</description>
      <pubDate>Fri, 14 Mar 2003 14:57:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927158#M110799</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2003-03-14T14:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Finding files with specific size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927159#M110800</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;If you want to do the ll and rm in "one go" with find:&lt;BR /&gt;&lt;BR /&gt;find . -size 84c -type f | xargs -i echo "ll {};rm {}" |sh&lt;BR /&gt;&lt;BR /&gt;rgds, Robin.</description>
      <pubDate>Fri, 14 Mar 2003 15:29:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-files-with-specific-size/m-p/2927159#M110800</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2003-03-14T15:29:08Z</dc:date>
    </item>
  </channel>
</rss>

