|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Recursive Find on file size
Is there a way to use the find command to recursively scan directories for files greater than 1Gb in size and print out the directory path and file name only?
Thanks in advance. |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Some versions of find support extra values for files sizes this is generic 1953125 by 512 byte blocks = 1GB, this produces tow columns = directory name and filename Code:
find /path -size +1953125 -print | while read fname do echo "$(dirname $fname) $(basename $fname)" done |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
2097151 ?
|
|
#4
|
||||
|
||||
|
If you have
GNU find available then use: Code:
find . -type f -size +1G Check your find version: Code:
find --version GNU find version 4.2.27 |
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
Thanks jim mcnamara, that is great. Do you know if it can be enhanced so that only the directories/files that the executing user id has access to are returned? ie, if a
Quote:
bipinajith, if I type Quote:
Quote:
|
| Sponsored Links | |
|
|
#6
|
||||
|
||||
|
Ok, that means you do not have
GNU find You can suppress the error messages by redirecting stderr to /dev/null Code:
find /path -size +1953125 -print 2> /dev/null |
| Sponsored Links | |
|
|
#7
|
|||
|
|||
|
Thanks bipinajith, that is perfect!
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Recursive find / grep within a file / count of a string | Charlie6742 | Shell Programming and Scripting | 9 | 12-04-2012 07:48 AM |
| How to find the latest file on Unix or Linux (recursive) | 1or2is3 | Shell Programming and Scripting | 7 | 02-27-2011 06:07 PM |
| find with file size and show the size | rpraharaj84 | Shell Programming and Scripting | 3 | 10-06-2009 01:42 PM |
| command to find out total size of a specific file size (spread over the server) | abhinov | Solaris | 3 | 08-08-2007 06:48 AM |
| find file with date and recursive search for a text | rosh0623 | UNIX for Advanced & Expert Users | 10 | 08-16-2006 02:27 PM |
|
|