Sponsored Content
Operating Systems Linux compare files in the system with last modified date Post 302141548 by porter on Friday 19th of October 2007 04:16:40 PM
Old 10-19-2007
try

find directory ! -newer candidate | xargs ls -ld

when that is showing you the correct files

replace "ls -ld" with "rm"

Note, it is your responsiblity to have the appropriate backups. Do not attempt this if you don't know what you are doing.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Create a list of files that were modified after a given date.

Hello Mates! I'm kinda new to unix and need to a solve a problem. Input: date Situation: With the given date I need to find a list of all such files starting from a given path that were modified after the given date. I experimented with the "find" with "-newer" but did not quite get it... (4 Replies)
Discussion started by: rkka
4 Replies

2. Shell Programming and Scripting

Compare date from db2 table to yesterday's Unix system date

I am currently running the following Korn shell script which works fine: #!/usr/bin/ksh count=`db2 -x "select count(*) from schema.tablename"` echo "count" I would like to add a "where" clause to the 2nd line that would allow me to get a record count of all the records from schema.tablename... (9 Replies)
Discussion started by: sasaliasim
9 Replies

3. UNIX for Dummies Questions & Answers

Find last modified date for many files

Hello all - I've looked and have not been able to find a "find" command that will list the last modified date of files within a specific directory and its subdirectories. If anyone knows of such a command it would be very much appreciated! If possible, I would like to sort this output and have... (5 Replies)
Discussion started by: MichaelH3947
5 Replies

4. UNIX for Dummies Questions & Answers

Number of files in a directory modified on a date

Hi How to list all the files in a directory that are modified on a particular date? Also need to know the count,i.e number of files modified on a particular date. Thanks Ashok (1 Reply)
Discussion started by: ashok.k
1 Replies

5. UNIX for Dummies Questions & Answers

mv folders/files without changing modified date?

Hi all, I'm using Red Hat Linux and want to move some folders and files around but not change the modified date. Is this possible? I know cp has a -p flag which seems to do what I want, but this is a large volume of data so copying and deleting would not be feasible. (13 Replies)
Discussion started by: Annorax
13 Replies

6. Shell Programming and Scripting

Adding days to system date then compare to a date

Hi! I am trying to read a file and every line has a specific date as one of its fields. I want to take that date and compare it to the date today plus 6 days. while read line do date=substr($line, $datepos, 8) #date is expected to be YYYYMMDD if ; then ...proceed commands ... (1 Reply)
Discussion started by: kokoro
1 Replies

7. Shell Programming and Scripting

How to get the files which has modified date as yesterday and before?

Hi All, Can you please help me to get only the files which has the modified date as yesterday and before? Thanks in advance! Regards, Velava.S (4 Replies)
Discussion started by: velava
4 Replies

8. Shell Programming and Scripting

Compare the system date with date from a text file

I get the date that's inside a text file and assigned it to a variable. When I grep the date from the file, I get this, Not After : Jul 28 14:09:57 2017 GMT So I only crop out the date, with this command echo $dateFile | cut -d ':' -f 2,4The result would be Jul 28 14:57 2017 GMT How do I... (3 Replies)
Discussion started by: Loc
3 Replies

9. UNIX for Beginners Questions & Answers

Compare date in .txt with system date and remove if it's lesser than system date

Can someone help me with the code wherein there is a file f1.txt with different column and 34 column have expiry date and I need to get that and compare with system date and if expiry date is <system date remove those rows and other rows should be moved to new file f2.txt . I don't want to delete... (2 Replies)
Discussion started by: Stuti
2 Replies

10. Answers to Frequently Asked Questions

Compare date in .txt with system date and remove if it's lesser than system date

I m working on shell scripting and I m stuck where in my .txt file there is column as expiry date and I need to compare that date with system date and need to remove all the rows where expiry date is less than system date and create a new .txt with update. (1 Reply)
Discussion started by: Stuti
1 Replies
RREP(1) 						      General Commands Manual							   RREP(1)

NAME
rrep - replace patterns in files. SYNOPSIS
rrep [OPTIONS] PATTERN REPLACEMENT [FILE...] DESCRIPTION
The rrep utility searches input FILEs for matches to a given PATTERN and replaces those matches by a given REPLACEMENT. The pattern is, by default, a basic regular expression. The replacement string may contain special characters to refer to portions of the matched pattern. Binary files are, by default, ignored. A file is regarded as binary if it contains the null character. OPTIONS
-E, --extended-regexp PATTERN is interpreted as an extended regular expression (ERE). -F, --fixed-strings PATTERN and REPLACEMENT are interpreted as fixed strings, not as regular expressions or escape sequences. -R, -r, --recursive Each directory that is given on the command line is processed recursively. Files and sub-directories starting with the . character are, by default, ignored. --include=FILE_PATTERN Only files are processed that match the pattern FILE_PATTERN, except for files that are specifically given on the command line. *, ?, and [...] can be used as wildcards in FILE_PATTERN. Wildcards and backslash characters can be quoted with . --exclude=FILE_PATTERN Files that match the pattern FILE_PATTERN will be skipped, except for files that are specifically given on the command line (using wildcard matching as described under --include). --exclude-dir=PATTERN Directories that match PATTERN will be skipped, except for files that are specifically given on the command line (using wildcard matching as described under --include). -V, --version Print the version number of rrep. -S SUFFIX, --suffix=SUFFIX Override default backup suffix. This option implicitly activates backups. -a, --all Files and sub-directories starting with the . character in recursively processed directories (see --recursive) are processed as well. -b Backup before overwriting files. The backup files are written into the directory of the original file. Equivalent to using --backup=existing. --backup[=CONTROL] Like -b but accepts a version control argument. The file name of the backup file is appended by a ~ character. The backup suffix is ~, unless set with --suffix or SIMPLE_BACKUP_SUFFIX. The version control method may be selected via the --backup option or through the VERSION_CONTROL environment variable. Here are the values: none, off never make backups (even if --backup is given) numbered, t make numbered backups existing, nil numbered if numbered backups exist, simple otherwise simple, never always make simple backups --binary Do not ignore binary files. A file is regarded as binary if it contains the null character . --dry-run The replacement is just simulated. No file is actually modified. -e PATTERN, --regexp=PATTERN Use PATTERN for matching. This option can be used to specify a pattern beginning with -. -h, --help Display a help message that descibes the command line options and exit afterwards. -i, --ignore-case Case distinctions in PATTERN are ignored. --keep-times The original access and modification times of files and directories are restored after processing. -p REPLACEMENT, --replace-with=REPLACEMENT Use REPLACEMENT for substitution. --interactive Each time before a file is modified the user is prompted and can cancel the modification. -q, --quiet, --silent All normal output messages are suppressed. -s, --no-messages All error messages are suppressed. -w, --word-regexp Only those matches of PATTERN are replaced that match whole words. -x, --line-regexp Only those matches of PATTERN are replaced that match whole lines. EXIT STATUS
Exit status is 1 if any error occurs, 0 otherwise. AUTHOR
Written by Arno Onken. REPORTING BUGS
If you find a bug in rrep, please send electronic mail to <asnelt@asnelt.org>. Include the version number, which you can find by running rrep --version. Also include in your message the output that the program produced and the output you expected. If you have other questions, comments or suggestions about rrep, contact the author via electronic mail to <asnelt@asnelt.org>. The author will try to help you out, although he may not have time to fix your problems. COPYRIGHT
Copyright 2011 Arno Onken This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. SEE ALSO
Regular Manual Pages find(1), grep(1), sed(1), xargs(1), regex(7). TeXinfo Documentation The full documentation for rrep is maintained as a TeXinfo manual. If the info and rrep programs are properly installed at your site, the command info rrep should give you access to the complete manual. User Commands rrep 1.3.3 RREP(1)
All times are GMT -4. The time now is 02:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy