- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: script to find big files
Operating System - Linux
1753962
Members
7473
Online
108811
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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-02-2007 06:44 AM
тАО08-02-2007 06:44 AM
script to find big files
I'm looking for a script that I know existed years ago.
what it did was find the big files that were on the system. saves the output. compares that output to a master list (known big files and their size) and mails the differences.
this way it filters out acceptable large files like the kernel, libraries, etc. and only mails the big files that are growing in size.
I was wondering if someone has a copy that they would be willing to share.
thanks
what it did was find the big files that were on the system. saves the output. compares that output to a master list (known big files and their size) and mails the differences.
this way it filters out acceptable large files like the kernel, libraries, etc. and only mails the big files that are growing in size.
I was wondering if someone has a copy that they would be willing to share.
thanks
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2007 06:48 AM
тАО08-02-2007 06:48 AM
Re: script to find big files
What do you mean by "big files"? Please say how big a "big file" should be in order to appear in the output of the desired script.
~thanks
~thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2007 07:27 AM
тАО08-02-2007 07:27 AM
Re: script to find big files
I would say that learning to write such a script is far more important than hunting one up to do such a straightforward task. I would almost certainly do this in Perl using the File::Find module but this should get you started as a shell example:
#!/usr/bin/sh
TDIR=${TMPDIR:-/var/tmp}
typeset F1=${TDIR}/F${$}_1.list
typeset BIG=1000000 # find any files larger that this
trap 'eval rm -f ${F1}' 0 1 2 3 15
find / -local -type f -size +${BIG}c -exec ls -l {} \+ | sort > ${F1}
File ${F1} now contain a list of "big" files that you can compare to your master list.
Presumably you master list is also sorted.
#!/usr/bin/sh
TDIR=${TMPDIR:-/var/tmp}
typeset F1=${TDIR}/F${$}_1.list
typeset BIG=1000000 # find any files larger that this
trap 'eval rm -f ${F1}' 0 1 2 3 15
find / -local -type f -size +${BIG}c -exec ls -l {} \+ | sort > ${F1}
File ${F1} now contain a list of "big" files that you can compare to your master list.
Presumably you master list is also sorted.
If it ain't broke, I can fix that.
- Tags:
- find
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP