Listing the file name and no of records in each files for the files created on a specific day


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Listing the file name and no of records in each files for the files created on a specific day
# 1  
Old 05-06-2014
Oracle Listing the file name and no of records in each files for the files created on a specific day

Hi,

I want to display the file names and the record count for the files in the 2nd column for the files created today.
i have written the below command which is listing the file names. but while piping the above command to the wc -l command
its not working for me.

Code:
ls -l --time-style='+%d/%m/%Y' | grep '06/05/2014' |  awk '{print $7}'

Need suggestion to get the file name and record count of the files.

Thanks
# 2  
Old 05-06-2014
try
Code:
for file in $(ls -ltr | grep "May  6" | awk '{print $9}');
do
 rc=`cat $file | wc -l`
 echo $file $rc
done

# 3  
Old 05-06-2014
Oracle

Thanks so much . But i want it in a command not using script. if possible.
# 4  
Old 05-06-2014
How about
Code:
find . -type f -mtime -1 -exec wc -l {} +

# 5  
Old 05-07-2014
Oracle

Thanks a lot Rudic. Its almost satisfied my requirement But along with the files created today it is also listing one more file which was created one day before.

Anyway thanks. I will explore more on -mtime and will get the solution.

Thanks for your time.
# 6  
Old 05-07-2014
Look into -mmin as well, and -daystart if available on your system.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Delete all files created in specific year

I have more than 200K files created in year 2017 under directory having size of 50GB. I want to all these files in one shot. Is there any faster option available with find command to delete all these file ? (6 Replies)
Discussion started by: sp23029
6 Replies

2. Shell Programming and Scripting

Files created on specific time

Hello Gurus, I am facing one issue to get a file for a specific time. There are about 300 files created between 6.30 pm to 7.15 pm everyday. Now I wanted only the file which is created on 6.45pm. No other files required. I have used "find" command to get the files, but not getting the expected... (3 Replies)
Discussion started by: pokhraj_d
3 Replies

3. Shell Programming and Scripting

Listing latest modified or created files recursively

Hi, I want to display latest files (created or modified) recursively in a path. I tried in different ways, but didn't get any desired output: find $path -type f -exec ls -lt {} \; | sort -n -r find $path -type f -printf %p";" | xargs -d ";" ls -t Second one is giving the error:... (21 Replies)
Discussion started by: karumudi7
21 Replies

4. UNIX for Dummies Questions & Answers

Listing files without specific expression in the file

I am running Ubuntu 11.10 I have the following files. geo2503r05690585.html geo2503r06020612.html geo2503r06250641.html geo2503r06490658.html geo2503r06830686.html geo2503r05860601.html geo2503r06130624.html geo2503r06420648.html geo2503r06590682.html ... (4 Replies)
Discussion started by: kristinu
4 Replies

5. Shell Programming and Scripting

Request for shell script for listing directories, subdirs containing specific files.

I'm looking for a script which outputs the list of directories and sub directories from root level consisting of specific files. For instance I want shell script to list all the directories and subdirectories containing .txt files.:wall: (4 Replies)
Discussion started by: super210
4 Replies

6. Shell Programming and Scripting

How to view files from a specific date/day

I wan to view files in a directory of a specific date. For example a log directory has log files . I want to view the list of the files which were generated on 01-May-2011. Is there any option/proces to perform it?? (1 Reply)
Discussion started by: mady135
1 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

Delete files created before specific date.

There is a system logging a huge amount of data and we need to delete some of the older logs .I mean the files that are created before one week from today. Here is a listing of files that are sitting there: /usr/WebSphere/AppServer/logs # ls -l -rw-r--r-- 1 root system 3740694 May... (5 Replies)
Discussion started by: moustafashawky
5 Replies

9. Filesystems, Disks and Memory

How to list files with specific created date

Hi, Would like to ask, which command is used to list all the files for specific date (says 1st May) and its size, for all files (including its subdirectory), in a mounted NFS disk to HP-UX. I would like to check for the total files came into my disk on 1st May. Very much appreciating your... (2 Replies)
Discussion started by: Draculla
2 Replies

10. Shell Programming and Scripting

List files created between specific date and time

Hi I need to write a script to list files in a directory created within specific date and time for eg list files created between Apr 25 2007 11:00 to Apr 26 2007 18:00. and then i have to count them Any suggestions pls ? (3 Replies)
Discussion started by: jazjit
3 Replies
Login or Register to Ask a Question