what is wrong with this find command


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users what is wrong with this find command
# 1  
Old 06-25-2009
what is wrong with this find command

i am trying to find the files which are more than 100MB and it was created 10 days ago.
find /lola/loaded -size +102400 -mtime -10 -print | xargs ls -ltr
-rw-rw-r-- 1 lola_adm gdrmp 82054170 Jun 23 06:17 /lola/loaded/ILMEMBER20090622.txt
-rw-rw-r-- 1 lola_adm gdrmp 652080494 Jun 24 03:10 /lola/loaded/web_monthly_0_d0905
-rw-rw-r-- 1 lola_adm gdrmp 652080494 Jun 24 03:24 /lola/loaded/web_monthly_1_d0905
-rw-rw-r-- 1 lola_adm gdrmp 652080494 Jun 24 03:36 /lola/loaded/web_monthly_2_d0905
-rw-rw-r-- 1 lola_adm gdrmp 652080000 Jun 24 03:50 /lola/loaded/web_monthly_3_d0905


But when i tried to find the files which are more than 10 MB and it was created 10 days ago.. using the below command, the produces an output with all the files in that directory. is there anything wrong with the find command.

find /lola/loaded -size +10240 -mtime -10 -print | xargs ls -ltr

please help...
# 2  
Old 06-25-2009
It's finding the directory file.
Confine the search to files only.

Code:
find /lola/loaded -type f -size +10240 -mtime -10 -print | xargs ls -ltr

# 3  
Old 07-02-2009
how do we use the depth and max depth in the find command.
# 4  
Old 07-02-2009
-d <depth>

or

-depth <depth>
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

What is wrong with 'find . -maxdepth 1 -ctime -7 -type f'?

Have you tried running the command below? On the same RHEl 6.8 or 6.6. It will give you different output. find . -maxdepth 1 -ctime -7 -type f rpm -qa|grep find findutils-4.4.2-9.el6.x86_64 # cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.8 (Santiago) # (6 Replies)
Discussion started by: invinzin21
6 Replies

2. Shell Programming and Scripting

Shell script to find the wrong filename in a path and raise a trap for it

Example: I have server name A with an IP : 125.252.235.455 I have an username /password to login into this server under SSH connection In this server i have a path /apps/user/filename(Big.txt) Everyday we used to get the filename as Big.txt. I want a shell script to monitor this path... (4 Replies)
Discussion started by: ChandruBala73
4 Replies

3. UNIX for Dummies Questions & Answers

Perl find & replace - what am I doing wrong?

Hi! I have a directory full of .plist type files from which I need to delete a line. Not every file contains the line, but of course I'd like to do it recursively. The line which I want to delete is: <string>com.apple.PhotoBooth</string> and looks like this in its native habitat: ... (9 Replies)
Discussion started by: sudon't
9 Replies

4. Shell Programming and Scripting

what's wrong with my regex using find

#ls json-* json-lexer.c json-lexer.h json-parser.c json-parser.h json-streamer.c json-streamer.h #find . -regex '^(json-)+.' return nothing (3 Replies)
Discussion started by: yanglei_fage
3 Replies

5. Shell Programming and Scripting

what's wrong with my -exec in find

find ./ -name *Kconfig -exec cat {} \; but it won't work with find ./ -name *Kconfig -exec cat {} |grep CONFIG_MTD |grep depend \; how could I handle this (14 Replies)
Discussion started by: yanglei_fage
14 Replies

6. Shell Programming and Scripting

What's wrong with the following command?

Hi all, I'm trying to run the following command to get all files in one directory to another with the files' timestamps preserved, cp -p /logs/dvgbiau/batch/* /logs/dvgbiau/tmp_batch Note that ./batch and ./tmp_batch are two sub-directories under /logs/dvgbiau. The error was,... (1 Reply)
Discussion started by: isaacniu
1 Replies

7. Shell Programming and Scripting

Check my script and correct the find command if wrong

Hello All, Here I am trying to find all the directories whose name starts with EFS or HOTFIX like in below example and below is my code but I don’t know why this is not working correctly. drwxr-xr-x 3 qabuild denccefs 4096 Sep 23 21:36 EFS110929A_SOURCE/ -rwxrwxr-x 1 qabuild... (2 Replies)
Discussion started by: anuragpgtgerman
2 Replies

8. Shell Programming and Scripting

Wrong output in find command

Hi guys - I am trying a small script to tell me if there is a file that exists less than 1k. It should report ERROR, otherwise the check is good. I wrote this script down, however it never runs in the if/then statement. It always returns the echo ERROR. MYSIZE=$(find /home/student/dir1... (8 Replies)
Discussion started by: DallasT
8 Replies

9. Shell Programming and Scripting

whats wrong with this find statement ?

cmd="find /a/technologies -name '*.jar' | grep \"Tuning/specificloader/lib\"" echo $cmd for index in `$cmd` do SL_JARS="${SL_JARS}:${index}" done gives error ==> find: paths must precede expression Usage: find but for index in... (2 Replies)
Discussion started by: crackthehit007
2 Replies

10. Shell Programming and Scripting

what i do wrong, find grep rm, help me plz

hello. i need find folders only with name 2006 and delete. find /path/to/dir/-07/ -type d | grep 2006 | -exec rm -rf {} \; and etc doesnt work :\ what i do wrong :? (4 Replies)
Discussion started by: djdes22
4 Replies
Login or Register to Ask a Question