[solved] Problem with find


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting [solved] Problem with find
# 1  
Old 08-13-2012
[solved] Problem with find

hi All,

I am using the command
Code:
find /home/mqm/check/ -mtime +1|wc -l

to get a count of the files older than a day under the check directory. But instead of getting the count of the files under check directory I m getting a count including the check directory itself. Can someone please tell me where i have to include the parameters list (like -f file ) in order to get the correct count?

Thanks in advance

---------- Post updated at 05:50 AM ---------- Previous update was at 05:07 AM ----------

Hi,

I have found the command for the above requirement its
Code:
find /home/mqm/check -type f -mtime +1|wc -l


Last edited by Franklin52; 08-13-2012 at 08:13 AM.. Reason: Please use code tags for data and code samples, thank you
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[Solved] Find command is not working

Hello Friends, I have a problem about a little script, when i run the following two lines one by one on CLI then they work well: /usr/bin/mkdir `perl -e 'use POSIX qw(strftime); print strftime "%Y-%m-%d",localtime(time() - 30*24*60*60);'` find . -type f -name "fuseesb.log.*" -mtime 30... (5 Replies)
Discussion started by: EAGL€
5 Replies

2. Shell Programming and Scripting

[Solved] Issue with deleting files through find

Hi, I have a script similar to this #!/bin/ksh cd /orcl/bir/eod_badfiles find ./ -type f -name "*.csv" -mtime +6 -exec rm -f {} \; find ./ -type f -name "*.bad" -mtime +6 -exec rm -f {} \; cd /orcl/bir find ./ -type f -name "*.log" -mtime +6 -exec rm -f {} \; This was working fine in one... (5 Replies)
Discussion started by: Gangadhar Reddy
5 Replies

3. Shell Programming and Scripting

[Solved] Grep within find command

Platform: AIX 6.1/ksh Question1. I want to grep for the string "CUSTOM_PKMS" in all the files in server except those files with extensions .dbf , .ctl and .dmp I started running the following command but it is taking too long because there are lots of .dbf , .ctl and .dmp files in this... (6 Replies)
Discussion started by: John K
6 Replies

4. UNIX for Dummies Questions & Answers

[Solved] Find entries from one file in another

Please help. I want to read a file line by line (only 1 column) and print all corresponding rows from a second file (2 columns) . Only first column of second file has to be matched with only column of first file. Order of lines in output doesn't matter. Simplified example Input 1 A B... (6 Replies)
Discussion started by: newbie83
6 Replies

5. UNIX for Dummies Questions & Answers

[Solved] Using w; how to list find all the users

Hi, On my system, I have about 75 users. Some uers have two or three sessions on the same systems. when I do w, it shows all the sessions. Is there any way to find only the users and not worry about how many sessions. For example: you can see sshe has four connection. I only want to know... (5 Replies)
Discussion started by: samnyc
5 Replies

6. Shell Programming and Scripting

find with wild card [solved]

Can somebody help me with the following syntax? I want to find all files that end with *.arc SUFFIX=".arc" find /tmp -name "\*$SUFFIX" -print 2>/dev/null ---------- Post updated at 03:45 PM ---------- Previous update was at 03:41 PM ---------- got it thanks -name... (0 Replies)
Discussion started by: BeefStu
0 Replies

7. UNIX for Dummies Questions & Answers

[Solved] Assistance with find command please

Trying to locate files less than xx days old, throughout all directories/subdirectories, but excluding certain types of directories and files. The directories I want to search all contain the same characteristic (dbdef, pldef, ghdef, etc), and there are subdirectories within that I need to... (2 Replies)
Discussion started by: Condmach
2 Replies

8. AIX

Problem Solved

Generally, most people, I guess, go from 5.3 ML4 Directly to TL 7. So they may never run into this issue. For the rest of us, here is the resolution of my problem in going from ML6 to TL7. Apparently with the change from ML to TL IBM added a "BuildDate Verification" routine into... (1 Reply)
Discussion started by: mrmurdock
1 Replies

9. Shell Programming and Scripting

Find Usage solved

How can I find the biggest file in a branch? I tried find / \*.\* | xargs du | sort -n 1,1 | head 1 but shell do nothings :( ---------- Post updated at 03:07 PM ---------- Previous update was at 02:41 PM ---------- Solved: find / -name \*.\* | xargs du | sort -nr | head -n 1 (0 Replies)
Discussion started by: Guccio
0 Replies

10. UNIX for Dummies Questions & Answers

How do I ignore certain dir while using find? solved.

Hello everyone, I'm a newbie. I've got a problem while using find. I know there is a way to do it in man find which is something like find . -wholename './src/emacs' -prune -o -print it works but i also want to use -daystart, -mtime, -type on it and i dont know whats the sequence of these... (0 Replies)
Discussion started by: aquaraider
0 Replies
Login or Register to Ask a Question