- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- File size percentage with respect to the 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
07-10-2001 11:18 AM
07-10-2001 11:18 AM
For example I have a /u01/export directory which is about 4GB used (we will take it as 100% just to compare with each file) and it contains about 20 files in it. Now I want to know in terms of percentages which file is having the maximum used percentage.
Thanks,
Gulam.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2001 11:33 AM
07-10-2001 11:33 AM
Re: File size percentage with respect to the directory.
This may not get you where you want to be, but perhaps you can use it as the heart of a script to produce the percentages you seek.
Let's say I want to see what is soaking up /var. Here's the command I'd use:
du -kx /var | sort rn | more
This will give me directory usage of /var (and below) in kbytes sorted largest to smallest.
Cheers,
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2001 11:36 AM
07-10-2001 11:36 AM
Re: File size percentage with respect to the directory.
How about this for a start (after which you could embellish with 'awk'):
# du -x /usr |sort -rk1n
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2001 11:40 AM
07-10-2001 11:40 AM
Re: File size percentage with respect to the directory.
You will get output in Kbytes followed by file name.
Cheers...
Satish.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2001 11:41 AM
07-10-2001 11:41 AM
Re: File size percentage with respect to the directory.
du -kx /u01/export | sort -nrk1 | more
Cheers...
satish.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2001 11:56 AM
07-10-2001 11:56 AM
Re: File size percentage with respect to the directory.
I whipped this up in about 3 minutes and it should be very close. You simply do dirpct.sh file1 file2 and it displays the filenamem, size, and pct used with respect to the current directory.
Regards, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2001 11:56 AM
07-10-2001 11:56 AM
SolutionI whipped this up in about 3 minutes and it should be very close. You simply do dirpct.sh file1 file2 and it displays the filenamem, size, and pct used with respect to the current directory.
.. oops, here's the attachment.
Regards, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2001 02:06 PM
07-10-2001 02:06 PM
Re: File size percentage with respect to the directory.
The sort args in my previous reply should of course be prefixed with a "-" as in
du -kx /var | sort -rn | more
Sorry for any confusion (and thanks for the "pro" hat!).
[no points on this one, please]