Sponsored Content
Top Forums Shell Programming and Scripting how to list all the files for today in the dir Post 302578657 by ajaypatil_am on Friday 2nd of December 2011 05:36:49 AM
Old 12-02-2011
how to list all the files for today in the dir

I am trying following ...
Code:
ls -ltrh | grep 'Dec  2'

but it is displaying files for last year also ..as this dir is full of files from last 3-5 yrs
I only want to files for today.

e.g .
Code:
ls -ltrh | grep 'Dec  2'
-rw-r-----   1 ajay    ajay          0 Dec  2  2010 text23.txt
-rw-r-----   1 ajay    ajay          0 Dec  2  2010 text22.txt
-rw-r-----   1 ajay    ajay          0 Dec  2  2010 text21.txt
-rw-r-----   1 ajay    ajay          0 Dec  2  2010 text20.txt
-rw-r-----   1 ajay    ajay          0 Dec  2 20:32 test.txt
-rw-r-----   1 ajay    ajay          0 Dec  2 20:32 test1.txt
-rw-r-----   1 ajay    ajay          0 Dec  2 20:32 text3.txt
-rw-r-----   1 ajay    ajay          0 Dec  2 20:32 text4.txt
-rw-r-----   1 ajay    ajay          0 Dec  2 20:37 test11.txt
-rw-r-----   1 ajay    ajay          0 Dec  2 20:37 text12.txt


Last edited by Franklin52; 12-03-2011 at 11:46 AM.. Reason: Please use code tags for data and code samples, thank you
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to list today's files

Hi, I am trying to list names of only today's files OR say, files which are not older than 1 hour and copy them in 'list.txt' file. I know, :ls > list.txt will list all the files. But, how to list today's files? Any help will be appriciated. (4 Replies)
Discussion started by: berlin_germany
4 Replies

2. UNIX for Dummies Questions & Answers

How to list all the files which are not generated today

How to list all the files which are not generated today, and move all the above files to backup dir. (2 Replies)
Discussion started by: redlotus72
2 Replies

3. UNIX for Dummies Questions & Answers

To list all the files created today with directory path

Hi, Can any one tell the command to list all the files that are created as of today from all the directories? The Command "ls -ltR" is listing all the files. But I want the list of files that has been created as of today along with the directory path:) Thank you in advance.:) Regards,... (4 Replies)
Discussion started by: meetusha.b
4 Replies

4. Shell Programming and Scripting

How to copy specified files from list of files from dir A to dir B

Hello, fjalkdsjfkldsajflkajdskl (3 Replies)
Discussion started by: pmeesara
3 Replies

5. Shell Programming and Scripting

Generate a change list of files/dir

Is there a tool that can diff a directory and generate a change list of files in that directory based on a previous snapshot on the directory? For example /etc/a.txt:changed /etc/b.txt:removed /etc/c.txt:added Thanks! (1 Reply)
Discussion started by: overmindxp
1 Replies

6. Shell Programming and Scripting

How to get a list of files in a dir w/o sub-directories?

Hi I am looking for the correct syntax to find all files in the current directory without listing sub-directoris. I was using the following command, but it still returns subdirectoris and files inside them: $ ls -laR | grep -v ^./ Any idea? Thanks PS I am in ksh88 (4 Replies)
Discussion started by: aoussenko
4 Replies

7. UNIX for Dummies Questions & Answers

How to list all files in dir and sub-dir's recursively along with file size?

I am very new to unix as well as shell scripting. I have to write a script for the following requirement. In have to list all the files in directory and its sub directories along with file path and size of the file Please help me in this regard and many thanks in advance. (3 Replies)
Discussion started by: nmakkena
3 Replies

8. Shell Programming and Scripting

Copy files to a dir using from a list

Hi all, I'd very grateful for some help with the following: I have a directory with several subdirectories with files in them. All files are named different, even between different subdirectories. I also have a list with some of those file names in a txt file (without the path, just the file... (5 Replies)
Discussion started by: foracoffee
5 Replies

9. Linux

List all files created today exclude last one

Hi, ALL thanks in advance, i listed all files using this command ls -ltr $(date +%Y%m%d)*.xmlbut i would like to exclude the last one created ; Best regard MEROUAN Use code tags, thanks. (4 Replies)
Discussion started by: merouan
4 Replies

10. Shell Programming and Scripting

List files in dir and grep accordingly

bash or c-shell On Solaris 10 I need a command that will list the files of a directory, and grep each of those filenames out of a static text file, and then only echo field 2 of the static text file. Something like this: #> ls -1 /home/dir/ | each filename grep $filename static.txt |awk... (4 Replies)
Discussion started by: ajp7701
4 Replies
Text::Diff::Table(3)					User Contributed Perl Documentation				      Text::Diff::Table(3)

NAME
Text::Diff::Table - Text::Diff plugin to generate "table" format output SYNOPSIS
use Text::Diff; diff @a, $b { STYLE => "Table" }; DESCRIPTION
This is a plugin output formatter for Text::Diff that generates "table" style diffs: +--+----------------------------------+--+------------------------------+ | |../Test-Differences-0.2/MANIFEST | |../Test-Differences/MANIFEST | | |Thu Dec 13 15:38:49 2001 | |Sat Dec 15 02:09:44 2001 | +--+----------------------------------+--+------------------------------+ | | * 1|Changes * | 1|Differences.pm | 2|Differences.pm | | 2|MANIFEST | 3|MANIFEST | | | * 4|MANIFEST.SKIP * | 3|Makefile.PL | 5|Makefile.PL | | | * 6|t/00escape.t * | 4|t/00flatten.t | 7|t/00flatten.t | | 5|t/01text_vs_data.t | 8|t/01text_vs_data.t | | 6|t/10test.t | 9|t/10test.t | +--+----------------------------------+--+------------------------------+ This format also goes to some pains to highlight "invisible" characters on differing elements by selectively escaping whitespace. Each element is split in to three segments (leading whitespace, body, trailing whitespace). If whitespace differs in a segement, that segment is whitespace escaped. Here is an example of the selective whitespace. +--+--------------------------+--------------------------+ | |demo_ws_A.txt |demo_ws_B.txt | | |Fri Dec 21 08:36:32 2001 |Fri Dec 21 08:36:50 2001 | +--+--------------------------+--------------------------+ | 1|identical |identical | * 2| spaced in | also spaced in * * 3|embedded space |embedded tab * | 4|identical |identical | * 5| spaced in | tabbed in * * 6|trailing spacesss |trailing tabs * | 7|identical |identical | * 8|lf line |crlf line * * 9|embedded ws |embedded ws * +--+--------------------------+--------------------------+ Here's why the lines do or do not have whitespace escaped: lines 1, 4, 7 don't differ, no need. lines 2, 3 differ in non-whitespace, no need. lines 5, 6, 8, 9 all have subtle ws changes. Whether or not line 3 should have that tab character escaped is a judgement call; so far I'm choosing not to. UNICODE
To output the raw unicode chracters consult the documentation of Text::Diff::Config. You can set the "DIFF_OUTPUT_UNICODE" environment variable to 1 to output it from the command line. For more information, consult this bug: <https://rt.cpan.org/Ticket/Display.html?id=54214> . LIMITATIONS
Table formatting requires buffering the entire diff in memory in order to calculate column widths. This format should only be used for smaller diffs. Assumes tab stops every 8 characters, as $DIETY intended. Assumes all character codes >= 127 need to be escaped as hex codes, ie that the user's terminal is ASCII, and not even "high bit ASCII", capable. This can be made an option when the need arises. Assumes that control codes (character codes 0..31) that don't have slash-letter escapes (" ", " ", etc) in Perl are best presented as hex escapes ("x01") instead of octal ("01") or control-code ("cA") escapes. AUTHOR
Barrie Slaymaker <barries@slaysys.com> LICENSE
Copyright 2001 Barrie Slaymaker, All Rights Reserved. You may use this software under the terms of the GNU public license, any version, or the Artistic license. perl v5.16.3 2011-04-17 Text::Diff::Table(3)
All times are GMT -4. The time now is 04:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy