f



List Files By Date Range

Is it possible to list a group of files by date range using UNIX
command (i.e. ls -alt), script, awk, etc.?  I just want to be able to
retrieve a list between dateA and dateB in script.

Thanks!
0
gilgantic
9/4/2004 4:22:02 AM
comp.unix.programmer 10848 articles. 0 followers. kokososo56 (350) is leader. Post Follow

5 Replies
6840 Views

Similar Articles

[PageSpeed] 29

> Is it possible to list a group of files by date range using UNIX
> command (i.e. ls -alt), script, awk, etc.?  I just want to be able to
> retrieve a list between dateA and dateB in script.

How about using 'find ... -newer <oldest-file>' and then also
'find ... \! -newer <newest-file>' and then using 'comm' to 
find the intersection of these two lists?

Alexis
0
Alexis
9/4/2004 5:55:55 AM
On Sat, 4 Sep 2004 07:55:55 +0200, Alexis Huxley wrote:

>> Is it possible to list a group of files by date range using UNIX
>> command (i.e. ls -alt), script, awk, etc.?  I just want to be able to
>> retrieve a list between dateA and dateB in script.
> 
> How about using 'find ... -newer <oldest-file>' and then also
> 'find ... \! -newer <newest-file>' and then using 'comm' to 
> find the intersection of these two lists?
> 
> Alexis

Or even just use -newer and ! -newer on the same find command line.
If you need to be specific about the date range you can use touch to create
files with a specific date.
Adam
0
Adam
9/4/2004 6:06:42 AM
On 2004-09-04, Alexis Huxley <ahuxley@gmx.net> wrote:

> How about using 'find ... -newer <oldest-file>' and then also
> 'find ... \! -newer <newest-file>' and then using 'comm' to 
> find the intersection of these two lists?

Or how about just using:

find ... -newer <oldest-file> \! -newer <newest-file>

.... and let one find command do it all for you? :-)

And if you want to specify a specific period, you can always
create <oldest-file> and <newest-file> yourself, with the needed timestamps:

$ touch -t 20040823 /tmp/oldfile
$ touch -t 20040824 /tmp/newfile
$ find /home/foo/documents -newer /tmp/oldfile \! -newer /tmp/newfile

-- 
Jurjen Oskam
"I often reflect that if "privileges" had been called "responsibilities" or
"duties", I would have saved thousands of hours explaining to people why
they were only gonna get them over my dead body." - Lee K. Gleason, VMS sysadmin
0
Jurjen
9/4/2004 8:27:16 AM
Alexis Huxley wrote:

>>Is it possible to list a group of files by date range using UNIX
>>command (i.e. ls -alt), script, awk, etc.?  I just want to be able to
>>retrieve a list between dateA and dateB in script.
> 
> 
> How about using 'find ... -newer <oldest-file>' and then also
> 'find ... \! -newer <newest-file>' and then using 'comm' to 
> find the intersection of these two lists?
> 
> Alexis

Or this variant where mtime is modification time in days
in this script:

find . -type f -mtime +1 -a -mtime -2 -exec /bin/ls -ld "{}" ";"

This gives me, on my system, all files which have been modified
more than one day ago, but less than or equal to 2 days ago.
I believe that the granularity is by calendar day, rather
than "24 hours or more ago".  Check the man page on your system
for more options to find.

NPL

P.S. - some folks prefer to use xargs version rather than
the exec version.  Your choice.


-- 
"It is impossible to make anything foolproof
because fools are so ingenious"
  - A. Bloch
0
Nick
9/4/2004 1:06:42 PM
gilgantic@yahoo.com (gilgantic) writes:

> Is it possible to list a group of files by date range using UNIX
> command (i.e. ls -alt), script, awk, etc.?  I just want to be able to
> retrieve a list between dateA and dateB in script.

find . -mmin -<start> -mmin +<end> -print


urs
0
Urs
9/5/2004 6:54:15 AM
Reply:

Similar Artilces:

List All Files in Directory Within a Range of Date
Hi, Is there a way to list all of the files in a directory within a range of date or just a specific date? Any helps are appreciated. TIA, -Chris On 2007-08-13, lazyboy_2k@yahoo.com <lazyboy_2k@yahoo.com> wrote: > Hi, > > Is there a way to list all of the files in a directory within a range > of date or just a specific date? Yes. Oh, you want to know what it is? man find. Look for the 'time' options. -- "Religion poisons everything." [email me at huge {at} huge (dot) org <dot> uk] On Aug 13, 12:48 pm, Huge <H...

List files between Dates
Please let me know how to get list of file between dates in AIX? Like files from Jan 1 2004 to Dec 31 2005.. thanks in advance On Jan 25, 3:07 pm, "vp" <vijay_...@yahoo.com> wrote: > Please let me know how to get list of file between dates in AIX? > > Like files from Jan 1 2004 to Dec 31 2005.. You can use the find(1) command to perform a qualified search. The specific options that you use with the find(1) command will depend on which date metadata you are looking at. Standard date metadata stored in the inode are ctime, mtime, and atime. Or, is the date someh...

Unix help required: one line comand to date Column to a fixed length file parsing the file name
Hi , I have a fixed length file of records size 50 , file_nm.YYYYMMDD.dat . My requirement is that : To parse the file name for date and add the apped this date to the end of each record . After this the resultant record size becomes 58 . Is there one line command with AWK /SED i can make use for this purpose . Thanks in Advance , Ajay ajay.balki wrote: > Hi , > > I have a fixed length file of records size 50 , > file_nm.YYYYMMDD.dat . > My requirement is that : To parse the file name for date and add the > apped this date to the end of each record . > > Aft...

Dates in a date range
Is there a way that I can get a resultset that contains unique dates in a given date range without the need to have a temporary table and a cursor? perhaps something like: declare @start_date as datetime declare @end_date as datetime set @start_date as '1/1/2005' set @end_date as '1/1/2006' select fn_getuniquedate(@start_date, @end_date) 1/1/2005 1/2/2005 1/3/2005 ... 12/31/2005 Any reason why you can't create a permanent Calendar table in your database? Calendars are useful for many types of query so it makes sense to have one if you need to do anything with dates....

Listing file name and date
Hello. I want to make an unix script which create a file with the name and the date of creation of the different files that there are in a directory sepparated by ; (name and directory). Can do you please help me? Thank you in advance. Wed, 19 Jan 2011 02:39:50 -0800, sinh 0 did cat : > Hello. > > I want to make an unix script which create a file with the name and the > date of creation of the different files that there are in a directory > sepparated by ; (name and directory). > > Can do you please help me? man ls sinh 0 <pascualjf@gmail.com> writes: ...

List date of file for all users
Hello, I'm trying to figure out how to write a script that will tell me the date of a file in each users /home. /home/joeuser/file.log It would be nice for this to loop through all the users, and print it to a file. I have no clue as to which way to go with this. I am not a programmer. I would really appreciate if someone could possibly point me in the correct direction. Thanks, Dale On 2007-01-02, ds713@yahoo.com wrote: > Hello, > I'm trying to figure out how to write a script that will tell me the > date of a file in each users /home. > > /home/joeuser/file.log &...

List of lists of lists of lists...
I would like to have a list of lists N times deep, and my solution is (in pseudocode): def deep(x): a=[x] return a mylist=[] for N: mylist=deep(mylist) Is there a more elegant way to do it? The maine idea is: from a list having the numbre of steps along N dimensions, generate a list with an item at each possible point. Example 1: N=2 list=[2,3] result=[[1,2],[1,2],[1,2]] Example 2: N=3 list=[3,1,2] result=[[[1,2,3]],[[1,2,3]]] -- Ángel Gutiérrez Rodríguez - agr@fq.uniovi.es Instituto de Ciencia de los Materiales de Madrid - CSIC SpLine - European Syncrothorn Radiat...

Date, date date date....
Date is driving me crazy. I simply need to calculate the age of a person: this is what doesn't work: public int getAge(Person person) { long d = new java.util.Date().getTime(); long m =person.dateOfBirth().getTime(); long l=d-m; SimpleDateFormat formatter = new SimpleDateFormat("yy"); return (new Integer(formatter.format(age))).intValue(); } I'm getting 91 for a person who's born in 1983 Since getYear() is depreciated I don't like to use that I found that Calender could do the job, but how do I cast Date into Calender in an easy way? hin...

Date range not found, please try again with a valid date range
(Please note I have waited about 4 hours for this to post on GigaNews. Am reposting with the admitted risk that it may double post. I apologize if this happens...) Using FM 5.0 for our non profit org to control and report on client visits and activities. Today, for some reason, I can't pull a report showing yesterday's visits. I don't know what happened at last evening's session-there was some indication that a problem occurred - it had something to do with being unable to view the last names of newly added records but no one at the session could clearly define what...

List file with Code and Access date.
Dear All, I have MPEX on my system. May I know how I can combine these two commands in a single commands. So I can delete the "644" code file with the date conditions. LISTF @(ACCDATE<TODAY-120),2 LISTF @(CODE="644"),2 With Warm Regards =-=-=-=-=-=-=-=-=-=-=- Harpreet Singh Chana Phone : (O) 6895 - 4326 Fax : (O) 6895 - 4991 -------- Notice -------- The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorized. If you a...

list of files modified after a given date
Hi, The command ls -ltr | grep "`date | cut -b 5-11`" | cut -b 55-80 gives me a list of files modified on a given date, but I couldn't com up with a command that could give me a list of files that were modifie after a given date. Any help or pointers would be highly appreciated - vghiy ----------------------------------------------------------------------- Posted via http://www.webservertalk.co ----------------------------------------------------------------------- View this thread: http://www.webservertalk.com/message239469.htm On Mon, 31 May 2004 22:21:13 +0000, vghiya...

HELP
I need to move files from one directory to another directory by date range. For example, I want to move all files with a timestamp of Oct 1, 2003 through Oct 31, 2003 to another directory. Is there are command or utility that will let me specify files by date range to move? FWIW, this is on a SCO Unix system. Many thanks. **** Post for FREE via your newsreader at post.usenet.com **** > Is there are command or utility that will let me specify files by date > range to move? you can achive your date-based move with the following commands. (But beware, find reports also files in subdi...

Database file listed as Unix executable
Hi everyone, I use FileMaker Server 7 on a Mac network. I recently noticed that the icon for our most used database looked different. (Looking at the actual database files in the library folder on the server.) I then saw that the "Kind" is listed as "Unix Executable File." All the other databases just say "Document." Also, in the Backups folder, the icon is normal and the Kind is Document for the database in question. I haven't done anything to the file in question except do a get info to look at its permissions. Anyone have any idea why it should be ...

list file through filter by recent date
hello... i am trying to filter certain files and display only to ones conscerning the actual date being read (such as TODAY) while : do echo PROCESOS LA003 - WAVEMANAGER # in these lines my goal is to get the second column ($2) which has the month and the third column ($3) that has the day. # the print month_cmp " " day_cmp is there to verify that it works fine awk '{ system("date |awk '{ month_cmp = $2 if ($3 < 10) { day_cmp = "0" $3 } else { day_cmp = $3 } print month_cmp " " day_cm...

creating a list of dates from file names
Hi still unfortunately i am having problems selecting characters from file names due to the fact that the stock ID's are between 2 and for characters long, for example.. TESCO_20081225 AB_20060914 AAL_20070914 I want to get a vector of stock ID's and a vector of dates. my code so far is as follows; clear; rootDir = 'C:\Users\Desltop\Dissertation Data\lse tmp = dir([rootDir '*.csv']); fnames = char({tmp.name}'); clear tmp; If the stock ID's had all been of equal length, i.e. 3 characters i know i could have used; stockIDs = unique(cellstr(fnames(:1:3))); But ...

file list sorted by creation date
Hi, I need to get a list of all files in a directory sorted by their date/time of creation. Please help. -- Posted via http://www.ruby-forum.com/. > I need to get a list of all files in a directory sorted by their > date/time of creation. > Please help. Unix like systems don't store file creation info[1]. For last modified, or access time, see the documentation for File. [1] http://www.faqs.org/faqs/unix-faq/faq/part3/section-1.html -- Anurag Priyam http://about.me/yeban/ 2011/1/8 Rajarshi Chakravarty <raj_plays@yahoo.com>: > Hi, > I ne...

Retrive file list in reverse date order
I am using the Win32 API FindFirstFile and FindNextFile to retrive a list of files in a folder. Does anyone know how to retrieve this list in reverse Creation date order ? Cheers JB "Jonathan Bishop" <Jonathan.Bishop@BTInternet.com> wrote in message news:cftf1p$5ej$1@hercules.btinternet.com... > I am using the Win32 API FindFirstFile and FindNextFile to retrive a list of > files in a folder. > > Does anyone know how to retrieve this list in reverse Creation date order ? > AFAIK you get the list in whatever order the kernel wants to give...

Getting Directory File list on Unix Box
Again a newbie to JSP. Here is my dilema: I have a jsp page that when it loads I need it to read the names of the files located in a directory on the UNIX web server that hosts the page. The directory is /u004/qms/ext_tables. Once it knows the names of the files I need to pass the names of those files to a Oracle Stored Procedure. I got the following code to work; however, it was on a Windows box with a mapped drive to the folder containing the file names I needed (o:\) When moved off the test box (WINNT) to the production box (UNIX), the code crashed. I need to modify the following to wo...

list all file lock in a file
Hi. I read the info manual of glibc for the advisory record lock using fcntl(2) function on my Linux system. It says that if the specific part of the file has more than one lock, fcntl(fd, F_GETLK, &lock) will only return information about one of them. After simple experiment, I found that fcntl(, F_GETLK, ) returns the first lock of the specific part if that part has more than two (read) locks. Is there any other way to get information of all lock in the specific part of a file? Or, is there any tool that list all locks in the given file? I tried fuser(1) and lsof(1). But both give ...

reading list of list to a file
i made a list of lists but i cant write it into a file. how do i get the first string in a sublist? -- View this message in context: http://www.nabble.com/reading-list-of-list-to-a-file-tp14239876p14239876.html Sent from the Python - python-list mailing list archive at Nabble.com. ...

list of lists of lists ....
Hi, I have a list of data (type A) my list can includes element of type A or a lists, these list can includes element of type A or a lists, and so on ... is there a simple way to obtain a single list of all the elemets of type A ? thanks yomgui I forgot the most important, I am looking for a non recursive method. thanks yomgui yomgui wrote: > > Hi, > > I have a list of data (type A) > my list can includes element of type A or a lists, > these list can includes element of type A or a lists, and so on ... > > is there a simple way to obtain a single list of all the elemets > of type A ? > > thanks > > yomgui recursion. def get_As(L): res = [] for elem in L: if isinstance(elem, A): res.append(elem) elif isinstance(elem, list): res += get_As(elem) return res i also have a Tree class in my rc: http://home.comcast.net/~faulkner612/programming/python/pythonrc.py yomgui wrote: > Hi, > > I have a list of data (type A) > my list can includes element of type A or a lists, > these list can includes element of type A or a lists, and so on ... > > is there a simple way to obtain a single list of all the elemets > of type A ? > > thanks > > yomgui doh. ok, so, recursion is just functional programming sugar for a loop. def get_As(L): checking = [elem for elem in L if isinstance(elem, list)] # the equivalent of elem in recursion all_As =...

Programmers, Programmers, Programmers, ...
As Steve Balmer correctly stated, while making his monkey dance, it is applications and hence programmers that make a platform. The fact though is that if you want to do professional programming, then Linux is the platform for you. I know that this statement will get the heckels up on a lot of trolls in C.O.L.A, but I have a recent experience that proves this. I am currently working for a Windows only house producing a system that receives and transmits around 1000 telegrams per second in each direction on a UDP socket, translates them into a different format and creates a log entry for each ...

which function should I use to list all of the FILE SYSTEMS in UNIX??
I want to make a program to minitor the usages of all of the file systems on my AIX or Linux systems. But I will not use shell commands like "df -k" for some FILE SYSTEMS maybe not mounted and "df -k" will not collect info about that FILE SYSTEM ,so I want to obtain theses info from system calls or lib functions . First I want to list all the FILE SYSTEMS on my OS ,which c function should I use ? Thanks! Tommy wrote: > I want to make a program to minitor the usages of all of the file systems on > my AIX or Linux systems. comp.unix.programmer is down the h...

which function should I use to list all of the FILE SYSTEMS in UNIX??
I want to make a program to minitor the usages of all of the file systems on my AIX or Linux systems. But I will not use shell commands like "df -k" for some FILE SYSTEMS maybe not mounted and "df -k" will not collect info about that FILE SYSTEM ,so I want to obtain theses info from system calls or lib functions . First I want to list all the FILE SYSTEMS on my OS ,which c function should I use ? Thanks! Tommy <oract666@gmail.com> wrote: > I want to make a program to minitor the usages of all of the file systems on > my AIX or Linux systems. > But I wi...

Web resources about - List Files By Date Range - comp.unix.programmer

File:Commons-logo.svg - Wikipedia, the free encyclopedia
This image, or parts of it, is an official logo or design used by Wikimedia Foundation or by one of its projects. It is copyrighted by the Wikimedia ...

tar (file format) - Wikipedia, the free encyclopedia
. tar was initially developed to write data to sequential I/O devices for tape backup purposes. It is now commonly used to collect many files ...

From The Career Files: Useful Advice For New Lawyers
Negative feedback can be difficult to hear. But it is one of the best ways to get information about what you need to learn and to do differently. ...

JWT Communications Exec Files Suit Against JWT and Its CEO For Racist, Sexist Comments
An agency is once again being charged with racist and misogynistic behavior and this time it's JWT. A discrimination suit has been filed in ...

Reporter Files Criminal Complaint Against Trump Campaign Manager
Michelle Fields , the reporter who says she was assaulted by Donald Trump ‘s campaign manager Corey Lewandowski , has filed a criminal complaint, ...

Michelle Fields Files Criminal Charges Against Corey Lewandowski
Benny Johnson of Independent Journal reports that Breitbart News reporter Michelle Fields has filed assault charges against Corey Lewandowski. ...

Germany is in possession of the leaked ISIS files and it thinks they are authentic
Business Insider Germany is in possession of the leaked ISIS files and it thinks they are authentic Business Insider FILE - In this Monday, ...

College student kicked off flight files discrimination complaint
College student kicked off flight files discrimination complaint

Brazil prosecutors file charges against former president
SAO PAULO (AP) — Sao Paulo state prosecutors say they filed money laundering and misrepresentation charges against former Brazilian President ...

Reporter files criminal complaint against Donald Trump's campaign manager
Michelle Fields, the Breitbart reporter who was allegedly roughed up by Donald Trump’s campaign manager, has filed a criminal complaint: Michelle ...

Resources last updated: 3/12/2016 7:38:20 AM