Results 1 to 3 of 3
Hello,
I am missing something obvious here...I know how to display file sizes which are greater than a certain limit, say 50MB by doing this
find . -size +50000k
But ...
- 05-19-2009 #1Just Joined!
- Join Date
- Mar 2009
- Posts
- 9
finding and printing size of files
Hello,
I am missing something obvious here...I know how to display file sizes which are greater than a certain limit, say 50MB by doing this
find . -size +50000k
But I am also interested in printing the size of the file when the above command gets executed. I have tried
find . -size +50000k | xargs ls -l
find . -size +50000k -print | ls -l
find . -size +50000k -type f -exec ls -l {}\;
When I run the above commands, it will print the directory names under the current directory. What am I missing here? Thanks in advance.
- 05-19-2009 #2Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
Put a space between the } and \
Google "find exec example" for more info.Code:find . -size +50000k -type f -exec ls -lh {} \; -rw------- 1 root root 256M 2009-05-19 14:11 ./sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/resource0 -rw------- 1 root root 256M 2009-05-19 14:11 ./sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/resource0_wc
- 05-19-2009 #3Just Joined!
- Join Date
- Mar 2009
- Posts
- 9
Thanks. find . -size +50000k -type f -exec ls -l {} \; did the trick.


Reply With Quote