LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 10-12-2015, 06:02 PM   #1
nix84
Member
 
Registered: Apr 2014
Posts: 276

Rep: Reputation: Disabled
find's results are perplexing


I am getting different results from the "find" command and some results that are not explained in the man page.
The command I am using should return the files modified in the last 2 days per the man page: find /var -mtime +1
Problem: regardless it returns 19614 lines of output.
If I change this to -1, -2, -3 I get 112, 115, and 139 lines of output respectively. The man page does not describe the minus parameters but I suspect that these may in fact be the lines modified in 2, 3, 4 days and there is a typo in the manual.
Can someone familiar with this command comment? Thanks
 
Old 10-12-2015, 06:20 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,776

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
"find -mtime +1" will return all files with modification times more than 24 hours ago, i.e., everything not modified in the last 24 hours.

The description for the "+" and "-" signs is near the top of the "TESTS" section of the manpage:
Numeric arguments can be specified as

+n for greater than n,

-n for less than n,

n for exactly n.
What you want is "-mtime -2" for files modified less than 2*24 hours ago.
 
2 members found this post helpful.
Old 10-13-2015, 02:24 AM   #3
nix84
Member
 
Registered: Apr 2014
Posts: 276

Original Poster
Rep: Reputation: Disabled
find's results are perplexing

Thanks a bunch that is EXACTLY what I suspected!
I will be checking the man page cuz I read it and it (I thought) was supporting what I had read elsewhere.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pgrep fails to find results gosssamer Linux - Software 2 05-16-2014 10:45 AM
how to find exact results from grep teorxv102 Linux - Newbie 5 11-12-2012 09:14 PM
Can't find LQ survey results... JimMcCall Linux - Software 1 10-05-2012 10:46 AM
find -mtime gives unexpected results amchargue Linux - Newbie 3 08-12-2010 04:19 PM
bash find results bendeco13 Linux - General 6 10-26-2004 11:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 04:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration