|
BASH search for large files
|
|
01-11-2010, 10:06 AM
Post: #1
|
|||
|
|||
|
BASH search for large files
Here is a list of sizes you can search for using Find
-size n[ckMGTP] True if the file's size, rounded up, in 512-byte blocks is n. If n is followed by a c, then the primary is true if the file's size is n bytes (characters). Similarly if n is followed by a scale indicator then the file's size is compared to n scaled as: k kilobytes (1024 bytes) M megabytes (1024 kilobytes) G gigabytes (1024 megabytes) T terabytes (1024 gigabytes) P petabytes (1024 terabytes) I am running this command as administrator. This print any file name that is 1G or bigger. the + sign means greater than. Code: sudo find / -size +1G -printso find searchers from the root directory which is / I use the -size parameter to set a size to search for then lastly I use the -print parameter to print out the results |
|||
|
01-11-2010, 11:59 AM
Post: #2
|
|||
|
|||
|
RE: BASH search for large files
I decided to show you what a script would look like for checking for file size. The sourcecode is attached in a zip.
Code: #!/bin/bash |
|||
|
01-11-2010, 08:32 PM
Post: #3
|
|||
|
|||
|
RE: BASH search for large files
Great work. You did a good calculation there !
There's a fine line between genius and insanity. I have erased this line. Oscar Levant There's a fine line between an administrator and black hat hacker. I have erased this line. Dr DEBCOL |
|||
|
« Next Oldest | Next Newest »
|





