- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- File size?
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp
Knowledge Base
Discussions
Forums
Discussions
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
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
09-25-2006 10:48 PM
09-25-2006 10:48 PM
Regards,
Sudhakaran.K
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2006 11:00 PM
09-25-2006 11:00 PM
Re: File size?
Many ways to do this.
ls -la | sort -rn
Gets you biggest to smallest. Add sort commands to get things the way you really want them.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2006 11:18 PM
09-25-2006 11:18 PM
Re: File size?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2006 11:24 PM
09-25-2006 11:24 PM
Re: File size?
you can try something like this, which will only list the /tmp directory:
# find /tmp -type f -exec ls -l {} \; |sort -k5n
You should not include too much of the file hierarchy in your search, as it maý consume too many system resources.
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2006 11:30 PM
09-25-2006 11:30 PM
Re: File size?
Obviously, this will take a while. Even though directories are technically files, I take it you'd like them excluded.
# get listing of all files
find / -local -type f -print | xargs ll > /tmp/filelist
# sort list lexicographically
sort -k9 < /tmp/filelist > /tmp/filelist_sorted_lex
# sort list by size
sort -n -k5 < /tmp/filelist > /tmp/filelist_sorted_size
# remove filelist
rm -f /tmp/filelist
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2006 11:32 PM
09-25-2006 11:32 PM
Re: File size?
this should work for you
1. ll |sort -nr
2. du -sk * |sort -nr
3. du |sort -nr |pg
regards
mano
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2006 11:56 PM
09-25-2006 11:56 PM
Solutionll -R /
but I'm sure that this is not what you really want. A basic HP-UX system has more than 5000 files and directories. They will be sorted in alphabetical order. If you want the files sorted by the modification time, use the command:
ll -Rt /
However, your first question was file size -- so I will assume that you have disk space problems. In thaty case, you do NOT want files sorted by size. You want the mountpoint that is almost full summarized by directory size within the mountpoint. Use du for that task:
du -kx / | sort -rn | head -20
du -kx /var | sort -rn | head -20
du -kx /usr | sort -rn | head -20
du -kx /opt | sort -rn | head -20
Then look at which directories are the largest. Now examin the directory to see why it is so large. Note that bad software will create large directories in / and these should be moved.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2006 12:48 AM
09-27-2006 12:48 AM
Re: File size?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2006 12:56 AM
09-27-2006 12:56 AM