<?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 Perl/ksh script to find files used by users... in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992278#M93260</link>
    <description>Ok,&lt;BR /&gt;&lt;BR /&gt;We have directories like /home11 that store users directories.  I need a perl/ksh script that searches the directories, lists the files from biggest to smallest and detirmines whther or not any of these diirectories or files is an orhan.&lt;BR /&gt;&lt;BR /&gt;-TIA</description>
    <pubDate>Thu, 20 Jul 2006 13:42:47 GMT</pubDate>
    <dc:creator>jmckinzie</dc:creator>
    <dc:date>2006-07-20T13:42:47Z</dc:date>
    <item>
      <title>Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992278#M93260</link>
      <description>Ok,&lt;BR /&gt;&lt;BR /&gt;We have directories like /home11 that store users directories.  I need a perl/ksh script that searches the directories, lists the files from biggest to smallest and detirmines whther or not any of these diirectories or files is an orhan.&lt;BR /&gt;&lt;BR /&gt;-TIA</description>
      <pubDate>Thu, 20 Jul 2006 13:42:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992278#M93260</guid>
      <dc:creator>jmckinzie</dc:creator>
      <dc:date>2006-07-20T13:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992279#M93261</link>
      <description>What do you mean by "an orphan"? The owning user no longer exists?</description>
      <pubDate>Thu, 20 Jul 2006 13:47:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992279#M93261</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2006-07-20T13:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992280#M93262</link>
      <description>Orphan file = not owned by anyone listed in the /etc/passwd file.</description>
      <pubDate>Thu, 20 Jul 2006 13:48:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992280#M93262</guid>
      <dc:creator>jmckinzie</dc:creator>
      <dc:date>2006-07-20T13:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992281#M93263</link>
      <description>This will get you started:&lt;BR /&gt;&lt;BR /&gt;find . -type f -nouser -print&lt;BR /&gt;</description>
      <pubDate>Thu, 20 Jul 2006 13:49:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992281#M93263</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-07-20T13:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992282#M93264</link>
      <description>Find and sort:&lt;BR /&gt;&lt;BR /&gt;# perl -MFile::Find -le'find(sub{-f and push@{$f{-s$_}},$File::Find::name},@ARGV);for$s(sort{$b&amp;lt;=&amp;gt;$a}keys%f){printf"%9d %s\n",$s,$_ for sort@{$f{$s}}}' /home11&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Thu, 20 Jul 2006 13:54:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992282#M93264</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2006-07-20T13:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992283#M93265</link>
      <description>Hi Jody:&lt;BR /&gt;&lt;BR /&gt;# find /home -xdev -nouser&lt;BR /&gt;# find /home -xdev -nogroup&lt;BR /&gt;&lt;BR /&gt;...will find your unowned (no password or no group)&lt;BR /&gt;&lt;BR /&gt;For listing the contents from largest to smallest:&lt;BR /&gt;&lt;BR /&gt;# du -xk /home|sort -k1nr&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 20 Jul 2006 13:54:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992283#M93265</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-07-20T13:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992284#M93266</link>
      <description>And plus ORPH indicator:&lt;BR /&gt;&lt;BR /&gt;# perl -MFile::Find -le'find(sub{-f and push@{$f{-s$_}},[$File::Find::name,(stat$_)[4]]},@ARGV);for$s(sort{$b&amp;lt;=&amp;gt;$a}keys%f){printf"%4s %9d %s\n",($_-&amp;gt;[1]eq getpwuid$_-&amp;gt;[1]?"ORPH":""),$s,$_-&amp;gt;[0] for sort@{$f{$s}}}' /home11&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Thu, 20 Jul 2006 14:00:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992284#M93266</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2006-07-20T14:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992285#M93267</link>
      <description>What I came up with...&lt;BR /&gt;&lt;BR /&gt;for file in $(find . -type f);&lt;BR /&gt;do&lt;BR /&gt;        filesize=$(ls -l $file | awk '{print $5}')&lt;BR /&gt;        fileowner=$(ls -l $file | awk '{print $3}')&lt;BR /&gt;        orphan=""&lt;BR /&gt;        if [[ $(grep -c "^$fileowner:" /etc/passwd) -eq 0 ]];&lt;BR /&gt;                then orphan="ORPHANED FILE!"&lt;BR /&gt;        fi&lt;BR /&gt;        echo "$filesize $file $orphan"&lt;BR /&gt;done | sort -nr +0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Jon</description>
      <pubDate>Thu, 20 Jul 2006 14:05:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992285#M93267</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2006-07-20T14:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992286#M93268</link>
      <description>OK, I really need to learn more perl :)</description>
      <pubDate>Thu, 20 Jul 2006 14:07:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992286#M93268</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2006-07-20T14:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992287#M93269</link>
      <description>Procura,&lt;BR /&gt;&lt;BR /&gt;Is there a way to combine the two perl statements?&lt;BR /&gt;&lt;BR /&gt;Sorry but, I am still trying to learn perl.&lt;BR /&gt;&lt;BR /&gt;THanks,</description>
      <pubDate>Thu, 20 Jul 2006 14:59:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992287#M93269</guid>
      <dc:creator>jmckinzie</dc:creator>
      <dc:date>2006-07-20T14:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992288#M93270</link>
      <description>Hi (again) Jody:&lt;BR /&gt;&lt;BR /&gt;Merijn's very elegant solution *does* combine the listing of file sizes and whether or not they are unowned.  There is one small bug (!) in his last post.  Try this instead:&lt;BR /&gt;&lt;BR /&gt;# perl -MFile::Find -le'find(sub{-f and push@{$f{-s$_}},[$File::Find::name,(stat$_)[4]]},@ARGV);for$s(sort{$b&amp;lt;=&amp;gt;$a}keys%f){printf"%4s %9d %s\n",(!defined getpwuid$_-&amp;gt;[1]?"ORPH":""),$s,$_-&amp;gt;[0] for sort@{$f{$s}}}' /home11&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Thu, 20 Jul 2006 15:53:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992288#M93270</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-07-20T15:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992289#M93271</link>
      <description>&lt;!--!*#--&gt;JRF, you're right. Thanks. We indeed should use&lt;BR /&gt;defined getpwuid &lt;BR /&gt;&lt;BR /&gt;But then I would use positive logic in the ternary&lt;BR /&gt;&lt;BR /&gt;# perl -MFile::Find -e'find(sub{-f and push@{$f{-s$_}},[$File::Find::name,(stat$_)[4]]},@ARGV);for$s(sort{$b&amp;lt;=&amp;gt;$a}keys%f){printf"%4s %9d %s\n",defined getpwuid$_-&amp;gt;[1]?"":"ORPH",$s,$_-&amp;gt;[0] for sort@{$f{$s}}}' /home11&lt;BR /&gt;&lt;BR /&gt;A small breadown:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; # perl&lt;BR /&gt;&lt;BR /&gt;the command invokation&lt;BR /&gt;&lt;BR /&gt;&amp;gt; -MFile::Find&lt;BR /&gt;&lt;BR /&gt;use modules File::Find. This is equivalent to&lt;BR /&gt;&lt;BR /&gt;use File::Find:&lt;BR /&gt;&lt;BR /&gt;in a script&lt;BR /&gt;&lt;BR /&gt;&amp;gt; -e&lt;BR /&gt;&lt;BR /&gt;command line option.&lt;BR /&gt;-e will use the next arg as a chunk of perl code&lt;BR /&gt;&lt;BR /&gt;&amp;gt; find (&lt;BR /&gt;&lt;BR /&gt;find is a function from the File::Find module, and has several invocation methods, basically that sums down to&lt;BR /&gt;&lt;BR /&gt;find (function, directories)&lt;BR /&gt;&lt;BR /&gt;as function can be a (reference to a) named sub or an anonymous sub, I always prefer to inline it in the call using sub { }&lt;BR /&gt;&lt;BR /&gt;The sub defines the actions being taken on all entries found&lt;BR /&gt;&lt;BR /&gt;&amp;gt; sub {&lt;BR /&gt;&amp;gt;     -f and push @{$f{-s$_}},[$File::Find::name,(stat$_)[4]]&lt;BR /&gt;&lt;BR /&gt;-f is a file test operator, defaulting to $_. If you want to do that explicitely, add it:&lt;BR /&gt;&lt;BR /&gt;# only scan *files*, not special files, symlinks, directories and fifos&lt;BR /&gt;-f $_ or return;&lt;BR /&gt;# Note that you have to use 'return', and not 'next' as you are leaving a sub, not skipping to the next file in a for or while loop. A common pitfall for find ()&lt;BR /&gt;# Now push the file info in a hash of lists&lt;BR /&gt;# The hash is `indexed' by the filesize (-s)&lt;BR /&gt;# For each entry, I push an anonymous list with two entries:&lt;BR /&gt;# 1. The full file name ($File::Find::name)&lt;BR /&gt;# 2. The owner of the file (stat $_)[4]&lt;BR /&gt;#    see perldoc -f stat&lt;BR /&gt;push @{$f{-s$_}}, [ $File::Find::name, (stat$_)[4] ];&lt;BR /&gt;&lt;BR /&gt;I chose to use the file size as base index for the hash, so descending sorting on the file size is now dead easy&lt;BR /&gt;&lt;BR /&gt;&amp;gt;     }, @ARGV);&lt;BR /&gt;&lt;BR /&gt;} is end of sub, @ARGV is the directories. @ARGV is the rest of the command line arguments&lt;BR /&gt;&lt;BR /&gt;So, now I have gathered all the info I need in a hash, I must show it&lt;BR /&gt;&lt;BR /&gt;&amp;gt; for $s (sort {$b &amp;lt;=&amp;gt; $a} keys %f) {&lt;BR /&gt;&lt;BR /&gt;$s is iterating over the numeriacally descending sorted (see perldoc -f sort) keys of the hash. As the keys are the file sizes, this meets your quest&lt;BR /&gt;&lt;BR /&gt;&amp;gt;     printf "%4s %9d %s\n", defined getpwuid $_-&amp;gt;[1] ? "" : "ORPH" , $s, $_-&amp;gt;[0] for sort @{$f{$s}}}&lt;BR /&gt;&lt;BR /&gt;OK, that is a lot on one line. Lets break that down some more to something more extendable&lt;BR /&gt;&lt;BR /&gt;# Get me the (alphabetically sorted) list of files that have this size&lt;BR /&gt;my @files = sort @{$f{$s}};&lt;BR /&gt;# Now iterate over it&lt;BR /&gt;foreach my $entry (@files) {&lt;BR /&gt;    # Each entry had the name and the uid&lt;BR /&gt;    # in an anonymous list&lt;BR /&gt;    my ($file, $uid) = @$_;&lt;BR /&gt;    if (defined getwpuid $uid) {&lt;BR /&gt;        # This file has a known user&lt;BR /&gt;        printf "%9d %s\n", $s, $file;&lt;BR /&gt;        }&lt;BR /&gt;    else {&lt;BR /&gt;        # ALARM: Orphaned file&lt;BR /&gt;        printf "ORPHANED: %9d %s\n", $s, $file;&lt;BR /&gt;        }&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;&amp;gt;' /home11&lt;BR /&gt;&lt;BR /&gt;As I used @ARGV for the directories to be found, I need to pass these as extra arguments. I could also have chosen to hardcode them in the find command, but the way it is both easier to move it to a script and to change it with command line editing&lt;BR /&gt;&lt;BR /&gt;Hope that helped.&lt;BR /&gt;One more note. Files without a named user from /etc/passwd do not have to be orphaned by means of the user being removed from the system. It can also be the uid of a file being retreived from a cpio or tar (sw depot) file that was installed from another system with uid's that do not match your's&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Fri, 21 Jul 2006 01:34:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992289#M93271</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2006-07-21T01:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992290#M93272</link>
      <description>Is there any way to pull the information for the directory at the same time?&lt;BR /&gt;&lt;BR /&gt;IE:&lt;BR /&gt;&lt;BR /&gt;ORPHDIR  /home11/%username%&lt;BR /&gt;&lt;BR /&gt;ORPH  size file&lt;BR /&gt;ORPH  size file&lt;BR /&gt;&lt;BR /&gt;DIR /home11/%username%&lt;BR /&gt;&lt;BR /&gt;Owner ID  Size file&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I gues what I am trying to say is can we make it say the username who owns the directory instead of ORPH if it is owned?&lt;BR /&gt;&lt;BR /&gt;I would like this to do the same for all the directories in /home11.&lt;BR /&gt;&lt;BR /&gt;-TIA....again sorry...still learning perl.&lt;BR /&gt;</description>
      <pubDate>Fri, 21 Jul 2006 08:58:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992290#M93272</guid>
      <dc:creator>jmckinzie</dc:creator>
      <dc:date>2006-07-21T08:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992291#M93273</link>
      <description>&lt;!--!*#--&gt;lt09:/tmp/home11 123 &amp;gt; ll -R&lt;BR /&gt;.:&lt;BR /&gt;total 2&lt;BR /&gt;627705 drwxrwxrwx  5 merijn users  120 2006-07-21 16:07 .&lt;BR /&gt;  4700 drwxrwxrwt 46 root   root  2312 2006-07-21 16:02 ..&lt;BR /&gt;627676 drwxrwxrwx  2 merijn users  168 2006-07-21 16:03 home1&lt;BR /&gt;959931 drwxrwxrwx  2 lp     users  168 2006-07-21 16:03 home2&lt;BR /&gt;960241 drwxrwxrwx  2  12345 root   168 2006-07-21 16:07 home3&lt;BR /&gt;&lt;BR /&gt;./home1:&lt;BR /&gt;total 0&lt;BR /&gt;627676 drwxrwxrwx 2 merijn users 168 2006-07-21 16:03 .&lt;BR /&gt;627705 drwxrwxrwx 5 merijn users 120 2006-07-21 16:07 ..&lt;BR /&gt;424038 -rw-rw-rw- 1 merijn users   0 2006-07-21 16:03 xx1&lt;BR /&gt;960214 -rw-rw-rw- 1 merijn users   0 2006-07-21 16:03 xx2&lt;BR /&gt;960245 -rw-rw-rw- 1 merijn users   0 2006-07-21 16:03 xx3&lt;BR /&gt;960287 -rw-rw-rw- 1 merijn users   0 2006-07-21 16:03 xx4&lt;BR /&gt;960290 -rw-rw-rw- 1 merijn users   0 2006-07-21 16:03 xx5&lt;BR /&gt;&lt;BR /&gt;./home2:&lt;BR /&gt;total 0&lt;BR /&gt;959931 drwxrwxrwx 2 lp     users 168 2006-07-21 16:03 .&lt;BR /&gt;627705 drwxrwxrwx 5 merijn users 120 2006-07-21 16:07 ..&lt;BR /&gt;960291 -rw-rw-rw- 1 merijn users   0 2006-07-21 16:03 xx1&lt;BR /&gt;960292 -rw-rw-rw- 1 merijn users   0 2006-07-21 16:03 xx2&lt;BR /&gt;960295 -rw-rw-rw- 1 merijn users   0 2006-07-21 16:03 xx3&lt;BR /&gt;960296 -rw-rw-rw- 1  12345 users   0 2006-07-21 16:03 xx4&lt;BR /&gt;960299 -rw-rw-rw- 1 merijn users   0 2006-07-21 16:03 xx5&lt;BR /&gt;&lt;BR /&gt;./home3:&lt;BR /&gt;total 0&lt;BR /&gt;960241 drwxrwxrwx 2  12345 root  168 2006-07-21 16:07 .&lt;BR /&gt;627705 drwxrwxrwx 5 merijn users 120 2006-07-21 16:07 ..&lt;BR /&gt;960301 -rw-rw-rw- 1 merijn users   0 2006-07-21 16:03 xx1&lt;BR /&gt;960303 -rw-rw-rw- 1 merijn users   0 2006-07-21 16:03 xx2&lt;BR /&gt;960304 -rw-rw-rw- 1 merijn users   0 2006-07-21 16:03 xx3&lt;BR /&gt;960305 -rw-rw-rw- 1  12345 users   0 2006-07-21 16:03 xx4&lt;BR /&gt;960306 -rw-rw-rw- 1 merijn users   0 2006-07-21 16:03 xx5&lt;BR /&gt;lt09:/tmp/home11 124 &amp;gt; perl -MFile::Find -e'find(sub{-f and push@{$f{-s$_}},[$File::Find::name,(stat$_)[4],(stat".")[4]]},@ARGV);for$s(sort{$b&amp;lt;=&amp;gt;$a}keys%f){printf"%-8s %9d %s\n",defined getpwuid$_-&amp;gt;[1]?"":getpwuid($_-&amp;gt;[2])||$_-&amp;gt;[2],$s,$_-&amp;gt;[0] for sort@{$f{$s}}}' /tmp/home11&lt;BR /&gt;                 0 /tmp/home11/home3/xx1&lt;BR /&gt;                 0 /tmp/home11/home3/xx2&lt;BR /&gt;                 0 /tmp/home11/home2/xx1&lt;BR /&gt;                 0 /tmp/home11/home2/xx2&lt;BR /&gt;                 0 /tmp/home11/home1/xx1&lt;BR /&gt;                 0 /tmp/home11/home1/xx2&lt;BR /&gt;                 0 /tmp/home11/home1/xx3&lt;BR /&gt;                 0 /tmp/home11/home1/xx4&lt;BR /&gt;                 0 /tmp/home11/home1/xx5&lt;BR /&gt;                 0 /tmp/home11/home2/xx3&lt;BR /&gt;lp               0 /tmp/home11/home2/xx4&lt;BR /&gt;                 0 /tmp/home11/home2/xx5&lt;BR /&gt;                 0 /tmp/home11/home3/xx3&lt;BR /&gt;12345            0 /tmp/home11/home3/xx4&lt;BR /&gt;                 0 /tmp/home11/home3/xx5&lt;BR /&gt;lt09:/tmp/home11 125 &amp;gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn [ still awaiting points ]</description>
      <pubDate>Fri, 21 Jul 2006 09:09:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992291#M93273</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2006-07-21T09:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992292#M93274</link>
      <description>do i add this to the end of the previous command&lt;BR /&gt;</description>
      <pubDate>Fri, 21 Jul 2006 09:16:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992292#M93274</guid>
      <dc:creator>jmckinzie</dc:creator>
      <dc:date>2006-07-21T09:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992293#M93275</link>
      <description>No, it's a replacement. Just copy-n-paste the command line&lt;BR /&gt;&lt;BR /&gt;# perl -MFile::Find -e'find(sub{-f and push@{$f{-s$_}},[$File::Find::name,(stat$_)[4],(stat".")[4]]},@ARGV);for$s(sort{$b&amp;lt;=&amp;gt;$a}keys%f){printf"%-8s %9d %s\n",defined getpwuid$_-&amp;gt;[1]?"":getpwuid($_-&amp;gt;[2])||$_-&amp;gt;[2],$s,$_-&amp;gt;[0] for sort@{$f{$s}}}' /home11&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Fri, 21 Jul 2006 09:20:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992293#M93275</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2006-07-21T09:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992294#M93276</link>
      <description>I copied and pasted as requested and i get output that looks like this...&lt;BR /&gt;&lt;BR /&gt;ORPH    297950 /home11/lacsnxb.precob/latinmpruat/new_prods.bcp&lt;BR /&gt;        294912 /home11/sybase/ase125/shared-1_0/jre1.2.2/lib/PA_RISC/libmlib_image.sl&lt;BR /&gt;ORPH    293093 /home11/credit10/creditdv/unit.rep&lt;BR /&gt;ORPH    293093 /home11/credit09/creditdv/unit.rep&lt;BR /&gt;ORPH    293093 /home11/credit06/creditdv/unit.rep&lt;BR /&gt;ORPH    292263 /home11/workgroup/ASPPHGFFC/gfmis/TRASH/cocpl.out&lt;BR /&gt;ORPH    292263 /home11/workgroup/ASPPHGFFC/gfmis/TRASH/ebipl.out&lt;BR /&gt;&lt;BR /&gt;Would like it to look like your example above...&lt;BR /&gt;&lt;BR /&gt;Sorry, I will learn this soon but I have a requirement due now and don't know anything about this.</description>
      <pubDate>Fri, 21 Jul 2006 09:39:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992294#M93276</guid>
      <dc:creator>jmckinzie</dc:creator>
      <dc:date>2006-07-21T09:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992295#M93277</link>
      <description>That cannot be a pste from my last port. You've still got the "ORPH" text in.&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Fri, 21 Jul 2006 09:56:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992295#M93277</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2006-07-21T09:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992296#M93278</link>
      <description>Sorry copied the wrong one....&lt;BR /&gt;&lt;BR /&gt;What do i do with this:&lt;BR /&gt;lt09:/tmp/home11 123 &amp;gt; ll -R&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This is the command: &lt;BR /&gt;&lt;BR /&gt;perl -MFile::Find -e'find(sub{-f and push@{$f{-s$_}},[$File::Find::name,(stat$_)[4],(stat".")[4]]},@ARGV);for$s(sort{$b&amp;lt;=&amp;gt;$a}keys%f){printf"%-8s %9d %s\n",defined getpwuid$_-&amp;gt;[1]?"":getpwuid($_-&amp;gt;[2])||$_-&amp;gt;[2],$s,$_-&amp;gt;[0] for sort@{$f{$s}}}' /home11&lt;BR /&gt;&lt;BR /&gt;output:&lt;BR /&gt;&lt;BR /&gt;6189         14218 /home11/lacsnxb.precob/.tmp/0429145524.out&lt;BR /&gt;6189         14218 /home11/lacsnxb.precob/.tmp/0502141739.out&lt;BR /&gt;6189         14217 /home11/lacsnxb/lampr12uat/emex_hist.out&lt;BR /&gt;6189         14217 /home11/lacsnxb/lampr12uat/hist.out&lt;BR /&gt;6189         14217 /home11/lacsnxb/lampr12uat/mpr_hist_dec12.out&lt;BR /&gt;6189         14217 /home11/lacsnxb/lampr12uat/mprhist.out&lt;BR /&gt;6189         14217 /home11/lacsnxb/latinmpruat/emex_hist.out&lt;BR /&gt;6189         14217 /home11/lacsnxb/latinmpruat/hist.out&lt;BR /&gt;6189         14217 /home11/lacsnxb/latinmpruat/mpr_hist_dec12.out&lt;BR /&gt;6189         14217 /home11/lacsnxb/latinmpruat/mprhist.out&lt;BR /&gt;&lt;BR /&gt;Sorry about my total lack of knowledge.</description>
      <pubDate>Fri, 21 Jul 2006 10:01:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992296#M93278</guid>
      <dc:creator>jmckinzie</dc:creator>
      <dc:date>2006-07-21T10:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Perl/ksh script to find files used by users...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992297#M93279</link>
      <description>ll is an alias for ls -l and ls -lR lists a folder recursively.&lt;BR /&gt;I entered it for you to show how it works&lt;BR /&gt;&lt;BR /&gt;# perl -MFile::Find -e'find(sub{-f and push@{$f{-s$_}},[$File::Find::name,(stat$_)[4],(stat".")[4]]},@ARGV);for$s(sort{$b&amp;lt;=&amp;gt;$a}keys%f){printf"%-8s %9d %s\n",defined getpwuid$_-&amp;gt;[1]?"":getpwuid($_-&amp;gt;[2])||$_-&amp;gt;[2],$s,$_-&amp;gt;[0] for sort@{$f{$s}}}' /home11&lt;BR /&gt;&lt;BR /&gt;output:&lt;BR /&gt;&lt;BR /&gt;6189 14218 /home11/lacsnxb.precob/.tmp/0429145524.out&lt;BR /&gt;6189 14218 /home11/lacsnxb.precob/.tmp/0502141739.out&lt;BR /&gt;6189 14217 /home11/lacsnxb/lampr12uat/emex_hist.out&lt;BR /&gt;6189 14217 /home11/lacsnxb/lampr12uat/hist.out&lt;BR /&gt;6189 14217 /home11/lacsnxb/lampr12uat/mpr_hist_dec12.out&lt;BR /&gt;6189 14217 /home11/lacsnxb/lampr12uat/mprhist.out&lt;BR /&gt;6189 14217 /home11/lacsnxb/latinmpruat/emex_hist.out&lt;BR /&gt;6189 14217 /home11/lacsnxb/latinmpruat/hist.out&lt;BR /&gt;6189 14217 /home11/lacsnxb/latinmpruat/mpr_hist_dec12.out&lt;BR /&gt;6189 14217 /home11/lacsnxb/latinmpruat/mprhist.out&lt;BR /&gt;&lt;BR /&gt;Correct. In this list, the 6189 at the start is the owner of the folder where the orphaned file is in, which in this case is an unknown user too :)&lt;BR /&gt;the 14217 is the file size&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Fri, 21 Jul 2006 10:10:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-ksh-script-to-find-files-used-by-users/m-p/4992297#M93279</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2006-07-21T10:10:42Z</dc:date>
    </item>
  </channel>
</rss>

