Find todays files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Find todays files
# 8  
Old 10-13-2018
I forgotten touch -t Though my preferred method when searching a precise timestamp...
# 9  
Old 10-15-2018
Would something like this help:-
Code:
touch -mt $(date +%Y%m%d0000) /tmp/start_of_today                 # Create a reference file with a timestamp starting at 00:00 today
find /etc /opt /tmp -type f -newer /tmp/start_of_today -ls        # Search for files in these 3 directories that are newer than the reference and list them.

The output is not quite the same as ls -l but it should be usable. It is far safer than trying to interpret the output from ls -l



I hope that this is useful.
Robin
This User Gave Thanks to rbatte1 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to keep todays files based on Timestamp

Hi i need to keep todays files based on timestamp and archive the remaining files ex: Managerial_Country_PRD_20150907.csv Managerial_Country_PRD_20150907.csv Managerial_Country_PRD_20150906.csv Managerial_Country_PRD_20150905.csv (6 Replies)
Discussion started by: ram1228
6 Replies

2. UNIX for Dummies Questions & Answers

Script to keep todays files based on Timestamp

Hi i need to keep todays files based on timestamp and archive the remaining files ex: Managerial_Country_PRD_20150907.csv Managerial_Country_PRD_20150906.csv Managerial_Country_PRD_20150905.csv (2 Replies)
Discussion started by: ram1228
2 Replies

3. Shell Programming and Scripting

Shell script to compare two files of todays date and yesterday's date

hi all, How to compare two files whether they are same are not...? like i had my input files as 20141201_file.txt and 20141130_file2.txt how to compare the above files based on date .. like todays file and yesterdays file...? (4 Replies)
Discussion started by: hemanthsaikumar
4 Replies

4. Shell Programming and Scripting

Count for only todays files.

Hi, I unable to find the direct command get the total count for the below files with today date. ls -lrt c90.txt n5.txt t1.txt k3.txt h9.txt s1.txt n2.txt a123.txt -rw-rw-r-- kkk klkl 980 Apr 26 19:00 c90.txt -rw-rw-r-- kkk klkl 80 Apr 26 19:00 n5.txt -rw-rw-r-- kkk klkl 12890 Apr 26... (3 Replies)
Discussion started by: onesuri
3 Replies

5. Shell Programming and Scripting

How to list todays and yesterdays .rej files from a directory?

I am trying to display todays and yesterdays .rej files from a directory. ls -lrt *.rej | grep 'Aug 12' ; ls -lrt *.rej | grep 'Aug 13' Which is working as above. But i want take 'Aug 12' and 'Aug 13' from a variable and the command should work everyday. I am able to get todays files by... (9 Replies)
Discussion started by: GopalKrishnaP
9 Replies

6. Shell Programming and Scripting

Find and copy files based on todays date and search for a particular string

Hi All, I am new to shell srcipting. Problem : I need to write a script which copy the log files from /prod/logs directory based on todays date like (Jul 17) and place it to /home/hzjnr0 directory and then search the copied logfiles for the string "@ending successfully on Thu Jul 17". If... (2 Replies)
Discussion started by: mail.chiranjit
2 Replies

7. UNIX for Dummies Questions & Answers

need to zip all the files excluding todays file

HI All, At present in my server the log folder was filled up and causing memory issue. So I am planning to write a script in such a way that the files which are older than 30 days will be deleted and also need to find the files which were not compressed and need to compress this file.... (4 Replies)
Discussion started by: arumilli
4 Replies

8. Shell Programming and Scripting

Find files having todays date and hostname in its name.

Hello, I am quite new to unix/shell and want to write a script using bash which will process the files. Basically i want to search files having name as "date+hostname+somestring.out" i am using below variables and then will use them in find command :- TODAY_DATE=$('date +%d')... (5 Replies)
Discussion started by: apm
5 Replies

9. Shell Programming and Scripting

Count todays created files and old files

Hello experts, I used following approach to get listing of all files of remote server. Now I have remote server file information on same server. I am getting listing in the output.txt I want to count today's created files and old files. I want to compare the numbers... (11 Replies)
Discussion started by: dipeshvshah
11 Replies

10. Shell Programming and Scripting

Shell script help to eliminate files of todays date

Hi I am very new to shell scripting and have written a script (below). However the directory I am searching will contain a file with a .trn extension each day which I want to eliminate. Each day the file extension overnight will change to trx, if this fails I want to know. Basically what I... (2 Replies)
Discussion started by: richM
2 Replies
Login or Register to Ask a Question