<?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 Unix ls command part II in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-ls-command-part-ii/m-p/2554493#M724963</link>
    <description>Hi, &lt;BR /&gt;Previous message ...&lt;BR /&gt;I was wondering if the ls command can list all files in a current directory with file size that is greater than some number and less than some number? ...&lt;BR /&gt;&lt;BR /&gt;Actually, this is part of a script I am writing.   Now, how would i be able to check if anything is returned?  ie.&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;elif [ $1 -lt $2 ] ; then&lt;BR /&gt;   find size ... -print&lt;BR /&gt;    if [  (pseudo) find size = 0 ] ; then&lt;BR /&gt;        echo "No such files!"&lt;BR /&gt;    fi&lt;BR /&gt;fi&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;I guess the problem is that I don't know the command i would use in (pseudo) ... any ideas?&lt;BR /&gt;&lt;BR /&gt;gracias ...&lt;BR /&gt;</description>
    <pubDate>Wed, 18 Jul 2001 19:47:01 GMT</pubDate>
    <dc:creator>Landen</dc:creator>
    <dc:date>2001-07-18T19:47:01Z</dc:date>
    <item>
      <title>Unix ls command part II</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-ls-command-part-ii/m-p/2554493#M724963</link>
      <description>Hi, &lt;BR /&gt;Previous message ...&lt;BR /&gt;I was wondering if the ls command can list all files in a current directory with file size that is greater than some number and less than some number? ...&lt;BR /&gt;&lt;BR /&gt;Actually, this is part of a script I am writing.   Now, how would i be able to check if anything is returned?  ie.&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;elif [ $1 -lt $2 ] ; then&lt;BR /&gt;   find size ... -print&lt;BR /&gt;    if [  (pseudo) find size = 0 ] ; then&lt;BR /&gt;        echo "No such files!"&lt;BR /&gt;    fi&lt;BR /&gt;fi&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;I guess the problem is that I don't know the command i would use in (pseudo) ... any ideas?&lt;BR /&gt;&lt;BR /&gt;gracias ...&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Jul 2001 19:47:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-ls-command-part-ii/m-p/2554493#M724963</guid>
      <dc:creator>Landen</dc:creator>
      <dc:date>2001-07-18T19:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Unix ls command part II</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-ls-command-part-ii/m-p/2554494#M724964</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;In your previous post I offered you the following:&lt;BR /&gt;&lt;BR /&gt;If you want to use 'ls' and limit the results returned by filesize, consider this method: &lt;BR /&gt;&lt;BR /&gt;# ls -l /tmp|awk '$5 &amp;gt; 1000 &amp;amp;&amp;amp; $5 &amp;lt; 3000 {print $0}' &lt;BR /&gt;&lt;BR /&gt;...this will return all files in the /tmp directory whose size is greater than 1000 and less than 3000. &lt;BR /&gt;&lt;BR /&gt;The fifth ($5) field returned is the size of the file.  If you want to pipe this command string into a file, you could then test whether that file was empty or not.&lt;BR /&gt;&lt;BR /&gt;You can also add the -R' option to the 'ls' command to make the search recursive.&lt;BR /&gt;&lt;BR /&gt;The bulk of this solution I suggested to you in your first post [to which you assigned *no* points, I might add].&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 18 Jul 2001 20:06:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-ls-command-part-ii/m-p/2554494#M724964</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-07-18T20:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Unix ls command part II</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-ls-command-part-ii/m-p/2554495#M724965</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;One very easy way to do this (if you are willing to limit yourself to 512-byte block resolution) is to use 2 -size args to find connected with -a (and).&lt;BR /&gt;&lt;BR /&gt;-size +1 will find all files greater than 1 block -size -5 will find all files less than 5 blocks.&lt;BR /&gt;&lt;BR /&gt;LO=1&lt;BR /&gt;HI=5&lt;BR /&gt;&lt;BR /&gt;find . \( -size +${LO} -a -size -${HI} \)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards, Clay&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Jul 2001 20:13:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-ls-command-part-ii/m-p/2554495#M724965</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-07-18T20:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Unix ls command part II</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-ls-command-part-ii/m-p/2554496#M724966</link>
      <description>If you are looking to only display a message when no files are found, then replace your code of...&lt;BR /&gt;if [ (pseudo) find size = 0 ] ; then &lt;BR /&gt;echo "No such files!" &lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;with (borrowing from Clay's example) &lt;BR /&gt;find . \( -size +${LO} -a -size -${HI} \) &amp;gt;/dev/null &amp;amp;&amp;amp; echo "No such files!"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Jul 2001 20:25:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-ls-command-part-ii/m-p/2554496#M724966</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2001-07-18T20:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Unix ls command part II</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-ls-command-part-ii/m-p/2554497#M724967</link>
      <description>Hello Landen,&lt;BR /&gt;&lt;BR /&gt;I'm not sure what you are asking.  Do you still need help with the command to show all files less than a number and greater than another number?  It almost sounds like this is a component to a larger script.&lt;BR /&gt;&lt;BR /&gt;Or, are you wanting some script writing help?  If so, it would be helpful if you could post more of your script.  Also, a little more information on what you want the final script to do would be helpful.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Jared</description>
      <pubDate>Wed, 18 Jul 2001 20:25:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-ls-command-part-ii/m-p/2554497#M724967</guid>
      <dc:creator>Jared Westgate_1</dc:creator>
      <dc:date>2001-07-18T20:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: Unix ls command part II</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-ls-command-part-ii/m-p/2554498#M724968</link>
      <description>Oops, my mistake...&lt;BR /&gt;&lt;BR /&gt;Use the following-&lt;BR /&gt;if [ `find . \( -size +${LO} -a -size -${HI} \) -print` ] ; then echo "No such Files!" ; fi&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Jul 2001 20:32:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-ls-command-part-ii/m-p/2554498#M724968</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2001-07-18T20:32:24Z</dc:date>
    </item>
  </channel>
</rss>

