Important finding --- find files greater than 1 MB


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Important finding --- find files greater than 1 MB
# 1  
Old 03-16-2009
Important finding --- find files greater than 1 MB

as we can find file greater than 1 MB with find command as:

find /dir -name '*' -size +1M
find /dir/* -name '*' -size +1M

but wats its doing is , its finding files only in current directory not in sub-directories. i want files from sub-directories too.

Please help... Thanx in advance...!!!!
# 2  
Old 03-17-2009
Quote:
Originally Posted by manoj_dahiya22
as we can find file greater than 1 MB with find command as:

find /dir -name '*' -size +1M
find /dir/* -name '*' -size +1M

but wats its doing is , its finding files only in current directory not in sub-directories. i want files from sub-directories too.

Please help... Thanx in advance...!!!!
try either
Code:
 
find . -size +1M
find ./dir -size +1M

# 3  
Old 03-17-2009
Thanx Vidyadhar85

but its producing same result....!
please let me know the solution if you find any ..... because its reuired in my project . i need to send details of files greate than 1 MB

Thanks agaain
# 4  
Old 03-18-2009
By default, the find command parses through sub-directories. What O/S Flavor are you on?


for example...

find . -print

will return a complete file listing for everything from the current directory down...

Note that not all U**X Flavor support the human readable size nomenclature. Try +1000k instead. All find command support sizes of b,c,w and k.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Please help list/find files greater 1G move to different directory

I have have 6 empty directory below. I would like write bash scipt if any files less "1000000000" bytes then move to "/export/home/mytmp/final" folder first and any files greater than "1000000000" bytes then move to final1, final2, final3, final4, final4, final5 and that depend see how many files,... (6 Replies)
Discussion started by: dotran
6 Replies

2. Shell Programming and Scripting

Find files greater than a particular date in filename.

I need a unix command which will find all the files greater that a particular date in the file name. say for example I have files like(filenaming cov : filename.YYDDMMSSSS.txt) abc.201206015423.txt abc.201207013456.txt abc.201202011234.txt abc.201201024321.txt efg.201202011234.txt... (11 Replies)
Discussion started by: lijjumathew
11 Replies

3. Shell Programming and Scripting

Finding older files using find command

Hi All, I want to find files which are older than 15 days. I have written a command as below, find -mtime +15 -print I understand (System date - last modified time of a file) should be greater than or equal to 15 days. This command returns files which are 15 days old.. i.e... (1 Reply)
Discussion started by: nshan
1 Replies

4. UNIX for Dummies Questions & Answers

How do I find files which are older than 30 days and greater than 1GB

Hi All, I know the separate commands for finding files greater than 30 days and finding files greater than 1GB. How do I combine these two commands? Meaning how do I find files which are > 1GB and older than 30 days? ;) (4 Replies)
Discussion started by: Hangman2
4 Replies

5. Shell Programming and Scripting

finding multiple files using find command

I am trying to search for 2 files using the find command as below find -name file1.txt -a -name file2.txt It doesn't give a result although the files exist in the folder, however when i try the following find -name file1.txt -o -name file2.txt It does give me the result. ./file2.txt... (4 Replies)
Discussion started by: vivek_damodaran
4 Replies

6. Shell Programming and Scripting

Trying to find files equal to and greater than

Hi Guys and Gals, I'm having some difficulty putting this check into a shell script. I would like to search a particular directory for a number of files. The logic I have is pretty simple: Find file named *.txt that are newer than <this file> and count them If the number of files is equal to... (4 Replies)
Discussion started by: bbbngowc
4 Replies

7. Shell Programming and Scripting

Finding absolute values greater than a certain value

Hi I am posting here for the first time. I am trying to write a script that reads a data file and tries to determine if any absolute values that are above 0.5 I was thinking it ought to be possible to do this with awk somehow. Are there any suggestions before I start reinventing the wheel? ... (4 Replies)
Discussion started by: jackygrahamez
4 Replies

8. Shell Programming and Scripting

Finding files with names that have a real number greater then difined.

I am trying to find all files in a directory whose name has a real number larger then the number I am looking for. For example: . |-- delta.1.5.sql |-- delta.2.1.sql |-- delta.2.2.sql |-- delta.2.3.sql |-- delta.2.4.sql `-- delta.2.5.sql I know my database is at 2.2 so I want an... (2 Replies)
Discussion started by: harmonwood
2 Replies

9. Shell Programming and Scripting

find - finding files.

I understand that to find a type of file using command find I could do "find -type f -name \*.htm -print". However, I wish to find all files BUT *.htm. Can I negate the search somehow? Again, I have peeked into the man files etc... If anyone has an answer, Thanks in Advance! (3 Replies)
Discussion started by: gsjf
3 Replies

10. UNIX for Dummies Questions & Answers

How can I automatically find important files???

how can I automatically check if important files exist in a directory and if not, automatically put the important files where they are needed say, I want to put .bashrc and a dozen other important files like it into every user's directory, how can I do this??? how do I check every user's... (4 Replies)
Discussion started by: TRUEST
4 Replies
Login or Register to Ask a Question

Featured Tech Videos