- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- top 3 users in a directory
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2005 08:00 PM
03-16-2005 08:00 PM
top 3 users in a directory
I wonder if there's a quick way to list top 3 users consuming the most diskspaces in a certain directory.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2005 08:13 PM
03-16-2005 08:13 PM
Re: top 3 users in a directory
du -k|sort -k1,1nr|pg
If not, I don't know of a way.
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2005 08:18 PM
03-16-2005 08:18 PM
Re: top 3 users in a directory
shows the disk usage of the directories beneath the point you run this command from.
not exactly the answer to your question but works for /home
regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2005 09:05 PM
03-16-2005 09:05 PM
Re: top 3 users in a directory
If you don't care about subdirectories then you can use this:
Create a file called "useme.awk" which contains:
{addit[$3]+=$5}
END {for (idx1 in addit) {printf ("%8s %10d\n",idx1,addit[idx1]);}}
Then do this:
ll | grep -v -e total -e ^d | awk -f useme.awk
Best regards,
Kent M. Ostby
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2005 09:45 PM
03-16-2005 09:45 PM
Re: top 3 users in a directory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2005 10:16 PM
03-16-2005 10:16 PM
Re: top 3 users in a directory
not the quickest way I guess, but it seems to work ok.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2005 11:45 PM
03-16-2005 11:45 PM
Re: top 3 users in a directory
while (<>){
($mode,$links,$owner,$group,$size)=split;
$total{$owner} +=$size;
}
foreach $owner (sort {$total{$b} <=> $total{$a}} keys %total) {
printf ("%12d %s\n",$total{$owner},$owner) if ($i++ < 3);
}
Hein.