Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 16 Dec 2018, 02:57
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Any tool to find files modified on specific days?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 3 [44 Posts]   Goto page: 1, 2, 3 Next
Author Message
MochiMoppel


Joined: 26 Jan 2011
Posts: 1716
Location: Japan

PostPosted: Sat 16 Apr 2016, 22:34    Post subject:  Any tool to find files modified on specific days?  

I'm looking for a tool which can list all files modified on specific days, e.g. all files modified from April 14th to April 15th. The tool should be able to scan a set of directories, not just recursively a single directory.
Any ideas?

 

Last edited by MochiMoppel on Sat 16 Apr 2016, 22:59; edited 1 time in total
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 13173
Location: Gatineau (Qc), Canada

PostPosted: Sat 16 Apr 2016, 22:38    Post subject:  

@Sailor Enceladus: You're quick on the draw! I had not finished!
I'm an "editing maniac". I can edit myself til I turn blue! Wink
~~~~~~~~~~~~~~~~~
Hello MochiMoppel.

To list the files modified on a certain day, open a terminal and type:
Code:
ls -Algot | grep "apr 14"
Explanation:
ls -Algot ~=> Lists the files in chronological order
grep "apr 14" ~=> Retains only the files that have "apr 14" in the < ls > listing.

Note: The month abbreviation that you indicate needs to be localized. E.g.: On my
Canadian French system, I have to type
Code:
ls -Algot | grep "avr 14"
to get the same results as a compatriot with a Canadian English system typing "apr 14".

I hope this helps. BFN.

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)

Last edited by musher0 on Sun 17 Apr 2016, 15:24; edited 2 times in total
Back to top
View user's profile Send private message 
Sailor Enceladus

Joined: 22 Feb 2016
Posts: 1547

PostPosted: Sat 16 Apr 2016, 22:41    Post subject:  

Nevermind. Laughing
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1716
Location: Japan

PostPosted: Sat 16 Apr 2016, 22:55    Post subject:  

Sorry, I should have made this clearer: I actually need to be able to find a range of days (and ideally a range of time). I will edit my initial post.

@musher0: Thanks, but ls command can only scan a single directory (the current directory). This is the same with my DoubleCommander, which otherwise does a good job.
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 13173
Location: Gatineau (Qc), Canada

PostPosted: Sat 16 Apr 2016, 23:31    Post subject:  

Hello again.

While you were refining your question Smile , I found two other ways, with the < tree >
command. (See attached.) Careful with < tree >, when piping through grep, the first
letter of the month is in capitals.

As to your "refined" question, there may be a way to filter the < ls > or < tree >
output with the < date > command. IIRC correctly, < date > can process a range of
dates. Please read the man file; it's somewhere in there.

Perhaps also there is a possibility with the < zip > utility, using its little-known -t
parameter. I see it this way: use
Code:
zip -0 -t <date> archive.zip dir(s)
and then you'd use
Code:
unzip -l archive.zip
to view the results. (I used zip -t in my "dailies" script for the current day, so I know
it is possible. But I have not used it as you want to use it for your results.) For
more info about the time capacity of < zip >, please type
Code:
zip -h2
in a terminal or refer to its man file.

This is the best I can come up with. I hope it helps you. BFN.
with_tree.jpg
 Description   The bottom example shows the hierarchy lines, while the top example does not.
 Filesize   27.08 KB
 Viewed   468 Time(s)

with_tree.jpg


_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)

Last edited by musher0 on Sun 17 Apr 2016, 15:32; edited 1 time in total
Back to top
View user's profile Send private message 
6502coder


Joined: 23 Mar 2009
Posts: 495
Location: Western United States

PostPosted: Sat 16 Apr 2016, 23:59    Post subject:  

Doesn't the "find" command do this?

I seem to recall that the -mmin option checks the modification time, and that something like

-mmin +20 -mmin -160

checks for files modified between 20 and 160 minutes ago. I might have the +/- backwards. I think there's also a -mtime option that works in days instead of minutes.

And "find" accepts multiple directories, doesn't it?
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1716
Location: Japan

PostPosted: Sun 17 Apr 2016, 03:49    Post subject:  

@musher0: I took a look at tree. Unfortunately not the right tool for the job. Would need a lot of looping and piping and still be limited.

@6502coder: Yes, find accepts multiple directories, even time ranges, but it scans for relative, not fixed times. The -mtime option specifies 24hour chunks, which is not the same as "day" in a file date.
Back to top
View user's profile Send private message 
smokey01


Joined: 30 Dec 2006
Posts: 2801
Location: South Australia :-(

PostPosted: Sun 17 Apr 2016, 04:04    Post subject:  

Pfilesearch seems to be able to do that. Just click on the Advanced button in Pfind.
_________________
Software <-> Distros <-> Tips <-> Newsletters
Back to top
View user's profile Send private message Visit poster's website 
trapster


Joined: 28 Nov 2005
Posts: 2118
Location: Maine, USA

PostPosted: Sun 17 Apr 2016, 18:09    Post subject:  

Code:
find . -type f -newermt 2016-04-014 ! -newermt 2016-04-15

_________________
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog
Back to top
View user's profile Send private message Visit poster's website 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1716
Location: Japan

PostPosted: Sun 17 Apr 2016, 22:16    Post subject:  

@smokey01: Pfind "seems" to offer this option, but I could never get it to produce reliable results. Does it work for you? Which version?

@trapster: My version of find (Slacko 5.6, GNU findutils 4.4.2) doesn't support the -newermt option - at least not officially, so I never gave it a try. Interestingly it seems to produce some results, but it doesn't catch all files modified within the specified date range. Hard to tell what it does when I don't know what it is supposed to do Crying or Very sad
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1716
Location: Japan

PostPosted: Mon 18 Apr 2016, 04:22    Post subject:  

trapster wrote:
Code:
find . -type f -newermt 2016-04-014 ! -newermt 2016-04-15
Finally I figured out why this doesn't work.

This works:
Code:
find . -type f -newermt "2016-04-13 23:59:59" ! -newermt "2016-04-15 23:59:59"

I still don't know if this is officially supported. What is supported and documented is the -newer FILE option, which would required a reference file and would be a terrible workaround. In any case find allows time ranges down to seconds precision. Not bad Very Happy
find_newermt.png
 Description   
 Filesize   63.48 KB
 Viewed   413 Time(s)

find_newermt.png

Back to top
View user's profile Send private message 
gcmartin

Joined: 14 Oct 2005
Posts: 6730
Location: Earth

PostPosted: Mon 18 Apr 2016, 04:41    Post subject:  

Are the ideas expressed here, applicable in any way to this thread?
_________________
Get ACTIVE Create Circles; Do those good things which benefit people's needs!
We are all related ... Its time to show that we know this!
3 Different Puppy Search Engines or use DogPile
Back to top
View user's profile Send private message 
ASD

Joined: 22 Mar 2016
Posts: 99

PostPosted: Mon 18 Apr 2016, 05:52    Post subject:  

Thank you to all contributors

The screen shot uses FileFinder (from rcrsn51 - currently withdrawn for lack of interest) with my personal and very minor modifications (they have to be minor as I cannot code).

My choice of "/" in the first row enables a search of all my mounted drive partitions (except my optical drive).

The second row uses MochiMoppel's example (starting from 31st March 2016 until today) and (just as a test) adds a size requirement and excludes zip and pet files.

Anyone who would like the FileFinder pet might PM rcrsn51 to show interest and see if he might help.
Shot.png
Description 
png

 Download 
Filename  Shot.png 
Filesize  32.19 KB 
Downloaded  226 Time(s) 
Back to top
View user's profile Send private message 
smokey01


Joined: 30 Dec 2006
Posts: 2801
Location: South Australia :-(

PostPosted: Mon 18 Apr 2016, 06:24    Post subject:  

MochiMoppel wrote:
@smokey01: Pfind "seems" to offer this option, but I could never get it to produce reliable results. Does it work for you? Which version?

You are quite correct. I couldn't get it to work either. I just noticed it had facilities to search between dates.

_________________
Software <-> Distros <-> Tips <-> Newsletters
Back to top
View user's profile Send private message Visit poster's website 
musher0

Joined: 04 Jan 2009
Posts: 13173
Location: Gatineau (Qc), Canada

PostPosted: Mon 18 Apr 2016, 15:49    Post subject:  

Hello all.

Frankly, the syntax of the following
Code:
tree -Dfishx / | awk '$2=="Apr" && $3 ~ /14|15|16/ && $4 ~ /:/' | sort -k 3
is much simpler than the convoluted one you have to resort to using find.

It took it less than 10 seconds to scan my entire system and come up with 1022 results.
The time and number of lines are shown in the attached screen capture.

I leave it to your appreciation. BFN
with_tree(1).jpg
 Description   (Top and right truncated to respect the forum guidelines on picture attachments.)
 Filesize   119.74 KB
 Viewed   322 Time(s)

with_tree(1).jpg


_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 3 [44 Posts]   Goto page: 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0709s ][ Queries: 12 (0.0056s) ][ GZIP on ]