Find files of particular day


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Find files of particular day
# 1  
Old 08-03-2010
Find files of particular day

Hi,

I need to find all files of particular day lets say for 2nd august in below.

Code:
-rw-r--r--   1 skl  eusdc       8168 Aug  5 19:31    aabc123.txt
-rw-r--r--   1 skl  eusdc       4251 Aug  5 19:31    aabc124.txt
-rw-r--r--   1 skl  eusdc       4252 Aug  6 19:31    aabc125.txt
-rw-r--r--   1 skl  eusdc       3895 Aug  6 19:31    aabc213.txt
-rw-r--r--   1 skl  eusdc       3896 Aug  2 19:31    aabc456.txt
-rw-r--r--   1 skl  eusdc       3183 Aug  2 19:31    aabc63453.txt
-rw-r--r--   1 skl  eusdc       3184 Aug  2 19:31    aabcqwe.txt
-rw-r--r--   1 skl  eusdc       1047 Aug  3 07:30    mnbvcc.txt
-rw-r--r--   1 skl  eusdc       1048 Aug  3 07:30    as54633.txt
-rw-r--r--   1 skl  eusdc       1047 Aug  3 07:30    poiuy78.txt
-rw-r--r--   1 skl  eusdc       1048 Aug  3 07:30    sdfsd.doc
-rw-r--r--   1 skl  eusdc      10596 Aug  3 07:30   dfgd.txt
-rw-r--r--   1 skl  eusdc      10600 Aug  3 07:30   qweqw.doc


Last edited by pludi; 08-03-2010 at 08:55 AM.. Reason: code tags, please...
# 2  
Old 08-03-2010
Code:
grep " Aug 2 " inputfile

# 3  
Old 08-03-2010
i need to find all files of lets say Aug 2 and the counts for a particular string lets say "abc" is present in the files received for Aug 2
# 4  
Old 08-03-2010
How about:
Code:
ls -ld *abc* | grep "Aug  2"

# 5  
Old 08-04-2010
It just give me files of Aug 3. How about finding the total count of a string lets say "sachin" in all the files of Aug 3
# 6  
Old 08-04-2010
Try

Code:
$ ls -l | awk '/Aug  2/ { print $NF }' | grep -c 'sachin'

# 7  
Old 08-04-2010
It still does not answer my question. It looks for string 'sachin' in the filenames which is i dont want. I need to find total count of string 'sachin' in the text present inside the files not in the filenames.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Error when connecting to remote server to find files with timestamp today's day

I am connecting to remote server and try to check if files with timestamp as Today's day are on the directory. Below is my code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly; Today=`date +%Y%m%d`; if ;then echo "We... (1 Reply)
Discussion started by: digioleg54
1 Replies

2. Shell Programming and Scripting

Find list of files modified for a given day ?

find list of files modified for a given day ? if i have 10 files in my directory, i have modified only 5 ... how to display only modified files ? (1 Reply)
Discussion started by: only4satish
1 Replies

3. HP-UX

Find Day of Week

In HP-UX the date command does not have the "-d" switch like some other *nixes do. I'm working a simple script to tell me, given the day, month and year what day of the week that falls on. Assuming valid day, month and year input (I'd perform quality checks on the input separately, but not... (5 Replies)
Discussion started by: rwuerth
5 Replies

4. UNIX for Dummies Questions & Answers

Move the files between Current day & a previous day

Hi All, I have a requirement where I need to first capture the current day & move all the files from a particular directory based on a previous day. i.e move all the files from one directory to another based on current day & a previous day. Here is what I am trying, but it gives me errors.... (2 Replies)
Discussion started by: dsfreddie
2 Replies

5. Shell Programming and Scripting

find files for next day of the date entered

i have few files generated everyday with a date stamp. Sometimes it happens that if the files are generated late i.e after 00:00 hrs the date stamp will be of the next day. example: 110123_file1 110123_file2 110123_file3 110124_file4 in the above example file4 is also for the previous... (2 Replies)
Discussion started by: gpk_newbie
2 Replies

6. Shell Programming and Scripting

Find the number of files older than 1 day from a dir

Hello All, I need to write a script/command which can find out the number of .csv files residing in a directory older than 1 day. The output should come with datewise (means for each date how many files are there). I've this command, but this command gives the total number of files. It's... (10 Replies)
Discussion started by: NARESH1302
10 Replies

7. Shell Programming and Scripting

to find all files created a day back

Hi Guys, My unix is SunOS. I like to find all the files which are created 1 day back. i tried the following command find . -type f -name '*.aud' -mtime +1 This gives me all the files created 48 hours back (2 days) but not one.. Can you let me know where i am going wrong. Thanks,... (8 Replies)
Discussion started by: mac4rfree
8 Replies

8. Shell Programming and Scripting

Script to find previous month last day minus one day timestamp

Hi All, I need to find the previous month last day minus one day, using shell script. Can you guys help me to do this. My Requirment is as below: Input for me will be 2000909(YYYYMM) I need the previous months last day minus 1 day timestamp. That is i need 2000908 months last day minus ... (3 Replies)
Discussion started by: girish.raos
3 Replies

9. Shell Programming and Scripting

find files modified more than a day

Hi All, I am using the below command to check the files modified within last 24hours find /home/karthik -mtime -1 -type f -exec ls -l {} \; What parameter do i need to add in the above command to check the files modified in last 2 or 3 days Kindly let me know if any other alternative... (2 Replies)
Discussion started by: karthikn7974
2 Replies

10. Shell Programming and Scripting

Write a shell script to find whether the first day of the month is a working day

Hi , I am relatively new to unix... Can u pls help me out to find out if the first day of the month is a working day ie from (Monday to Friday)...using Date and If clause in Korn shell.. This is very urgent. Thanks for ur help... (7 Replies)
Discussion started by: phani
7 Replies
Login or Register to Ask a Question