- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: finding out large file and 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
08-22-2007 04:00 AM
08-22-2007 04:00 AM
i have to find out the large file and directory. i searched in our ITRC and almost all the "find" commands gives many "find: cannot open /var/opt/xyz.." which i like to discard.
or
how to find out the 10 largest files in current directory??
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2007 04:10 AM
08-22-2007 04:10 AM
Re: finding out large file and directory
du -sk * |sort -n |tail -10
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2007 04:12 AM
08-22-2007 04:12 AM
Re: finding out large file and directory
that will not display "find: cannot open"
add -size option to find files bigger then a certain size.
man find for details...
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2007 04:14 AM
08-22-2007 04:14 AM
Re: finding out large file and directory
try this:
ls -l| sort -nrk5| head -10
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2007 04:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2007 04:17 AM
08-22-2007 04:17 AM
Re: finding out large file and directory
that will list all files bigger then 10240 bytes...
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2007 04:23 AM
08-22-2007 04:23 AM
Re: finding out large file and directory
# du -xk|sort -rnk1,1|head -11
...will show the top-10 *directories* in 1k blocks
# find /path -xdev -type f -exec ls -l {} + 2> /dev/null | sort -knr5,5 | head -10
...will find 10-largest *files* in the directory /path discarding any STDERR messages from 'find'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2007 05:24 AM
08-22-2007 05:24 AM
Re: finding out large file and directory
find /var/opt/ -type f -exec ls -l {} \+ 2>/dev/null | sort -k n5,5 | tail -n 50
this command gives exactly what i want.
still, to drill down the required result,
i would like not searching in some paths..say "/var/opt/bin/" inside this i dont want to "find"
in other words, lets think like i have to find large files in / while excluding /bin/ , /stand and /sbin
thanks a lot admins..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2007 05:31 AM
08-22-2007 05:31 AM
Re: finding out large file and directory
You can use:
find /var/opt/ ! -path "/var/opt/bin/*"
And just repeat for more directories.
(There is no /bin/, it's just a link, so you need to exclude /usr/bin/.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2007 05:34 AM
08-22-2007 05:34 AM
Re: finding out large file and directory
> lets think like i have to find large files in / while excluding /bin/ , /stand and /sbin
First, if you are gonig to start with '/' you probably want to add the '-xdev' switch so that you do *not* visit mountpoints:
# find / -xdev -type f ...
Since '/bin' is a symbolic link to '/usr' this will eliminate visiting that directory. As for skipping '/stand' and '/sbin' do:
# find / -xdev -type f ! -path "/sbin/*" -a ! -path "/stand/*"
THUS, in all:
# find / -xdev -type f ! -path "/sbin/*" -a ! -path "/stand/*"
-exec ls -l {} + 2> /dev/null | sort -knr5,5 | head -10
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2007 09:20 PM
08-22-2007 09:20 PM
Re: finding out large file and directory
# find / â xdev â size +3145728c (To list >=3MB)
# find / -xdev -size +8388608c (To list >=8MB)
# find / -xdev -size +10485760c (To list >=10MB)
# find / -xdev -size +104857600c (To list >=100MB)
# find / -xdev -size +1073741824c (To list >=1GB)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2007 02:25 AM
08-23-2007 02:25 AM