Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to find a file that's modified more than 2 days ago but less than 5 days ago? Post 303012834 by RudiC on Saturday 10th of February 2018 08:42:22 AM
Old 02-10-2018
Please be aware that the results you get from above are depending on the point of time you run it, as the "n*24 hours ago" period starts exactly then. Run at 14:33h with -mtime +2, a file modified two days ago at 14:30h will show up, and one from 14:35h will not. Run at 14:35h, both files will show up.
Does your find version offer the -daystart option? If not, you might need to adapt the -mmin test...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Deleting files created before two days ago

Dear All: I want to build a shell that delete files created two or more days ago ... I think it could be built using a special command with ls or grep, I'd apreciate any help from you guys I have a lot of log files from november, december, january and this tool will help me a lot The files... (3 Replies)
Discussion started by: josecollantes
3 Replies

2. Shell Programming and Scripting

Function 7 days ago

Please tell me how can I wirte a function to return the date 7 days ago by using calendar command? :confused: (2 Replies)
Discussion started by: LAY
2 Replies

3. UNIX for Dummies Questions & Answers

file was created before 15 days ago.

How can I get difference date between today and 15 days ago and all filename is was created before 15 days ago? It has to be korn shell script. Thanks. (1 Reply)
Discussion started by: YoungBlood
1 Replies

4. Shell Programming and Scripting

Find the file from 15 days ago

How can I get difference date between today and 15 days ago and all filename is was created before 15 days ago? It has to be korn shell script. Thanks. (2 Replies)
Discussion started by: YoungBlood
2 Replies

5. Shell Programming and Scripting

date for two days or 3 days ago

i need a script that can tell me the date 2 days ago or 3 days ago. please help (7 Replies)
Discussion started by: tomjones
7 Replies

6. Shell Programming and Scripting

Date within a timeframe 2 days ago

How could I using the following example, change it to show 2 days ago within the same time frame 0600 AM to 0600 AM let foo=`date "+(1%H-106)*60+1%M-100"` bar=foo+1440 find . -mmin +$foo -mmin -$bar | tr -s '/','-' '^' | cut -f2,3 -d"^" | tr -s '^' ' ' | Please use code tags (7 Replies)
Discussion started by: freddie999
7 Replies

7. Shell Programming and Scripting

Find unix file created how many days ago?

i want to find unix file created how many days ago? (4 Replies)
Discussion started by: utoptas
4 Replies

8. UNIX for Advanced & Expert Users

N days ago

Hi, the following gives today $(date '+%d%m%y') For example 210111 for today (21 of january 2011). How can I have n days ego ? For example 160111 for 5 days ego ? thank you. (3 Replies)
Discussion started by: big123456
3 Replies

9. Shell Programming and Scripting

Find a string in file 5 days ago

Hi, I need to grep for a string "Color Yellow" in all log files dated 5 days back until today's date . So, as today is 20 Dec i need to find in all logs from 16th dec to 20 dec. Also, i need ls -ltre output for the files that have the "Collor Yellow" string. Below is my OS: ... (1 Reply)
Discussion started by: mohtashims
1 Replies

10. Shell Programming and Scripting

Get a given date and subtract it to 5 days ago

Hi all, I have been researching to obtain SSL certification expiry for most of our webistes. For some cases, some hosts where not directly accessible so i finally got a solution working with curl using my proxy. This lists the expiry date which i'm finally looking for. # curl --proxy... (4 Replies)
Discussion started by: nms
4 Replies
GIT-REFLOG(1)                                                       Git Manual                                                       GIT-REFLOG(1)

NAME
git-reflog - Manage reflog information SYNOPSIS
git reflog <subcommand> <options> DESCRIPTION
The command takes various subcommands, and different options depending on the subcommand: git reflog [show] [log-options] [<ref>] git reflog expire [--expire=<time>] [--expire-unreachable=<time>] [--rewrite] [--updateref] [--stale-fix] [--dry-run | -n] [--verbose] [--all | <refs>...] git reflog delete [--rewrite] [--updateref] [--dry-run | -n] [--verbose] ref@{specifier}... git reflog exists <ref> Reference logs, or "reflogs", record when the tips of branches and other references were updated in the local repository. Reflogs are useful in various Git commands, to specify the old value of a reference. For example, HEAD@{2} means "where HEAD used to be two moves ago", master@{one.week.ago} means "where master used to point to one week ago in this local repository", and so on. See gitrevisions(7) for more details. This command manages the information recorded in the reflogs. The "show" subcommand (which is also the default, in the absence of any subcommands) shows the log of the reference provided in the command-line (or HEAD, by default). The reflog covers all recent actions, and in addition the HEAD reflog records branch switching. git reflog show is an alias for git log -g --abbrev-commit --pretty=oneline; see git-log(1) for more information. The "expire" subcommand prunes older reflog entries. Entries older than expire time, or entries older than expire-unreachable time and not reachable from the current tip, are removed from the reflog. This is typically not used directly by end users -- instead, see git-gc(1). The "delete" subcommand deletes single entries from the reflog. Its argument must be an exact entry (e.g. "git reflog delete master@{2}"). This subcommand is also typically not used directly by end users. The "exists" subcommand checks whether a ref has a reflog. It exits with zero status if the reflog exists, and non-zero status if it does not. OPTIONS
Options for show git reflog show accepts any of the options accepted by git log. Options for expire --all Process the reflogs of all references. --expire=<time> Prune entries older than the specified time. If this option is not specified, the expiration time is taken from the configuration setting gc.reflogExpire, which in turn defaults to 90 days. --expire=all prunes entries regardless of their age; --expire=never turns off pruning of reachable entries (but see --expire-unreachable). --expire-unreachable=<time> Prune entries older than <time> that are not reachable from the current tip of the branch. If this option is not specified, the expiration time is taken from the configuration setting gc.reflogExpireUnreachable, which in turn defaults to 30 days. --expire-unreachable=all prunes unreachable entries regardless of their age; --expire-unreachable=never turns off early pruning of unreachable entries (but see --expire). --updateref Update the reference to the value of the top reflog entry (i.e. <ref>@{0}) if the previous top entry was pruned. (This option is ignored for symbolic references.) --rewrite If a reflog entry's predecessor is pruned, adjust its "old" SHA-1 to be equal to the "new" SHA-1 field of the entry that now precedes it. --stale-fix Prune any reflog entries that point to "broken commits". A broken commit is a commit that is not reachable from any of the reference tips and that refers, directly or indirectly, to a missing commit, tree, or blob object. This computation involves traversing all the reachable objects, i.e. it has the same cost as git prune. It is primarily intended to fix corruption caused by garbage collecting using older versions of Git, which didn't protect objects referred to by reflogs. -n, --dry-run Do not actually prune any entries; just show what would have been pruned. --verbose Print extra information on screen. Options for delete git reflog delete accepts options --updateref, --rewrite, -n, --dry-run, and --verbose, with the same meanings as when they are used with expire. GIT
Part of the git(1) suite Git 2.17.1 10/05/2018 GIT-REFLOG(1)
All times are GMT -4. The time now is 10:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy