01-22-2007
Quote:
Originally Posted by sb008
find . -type f -mtime 2 (exactly 2 days)
find . -type f -mtime +2 (2 days or more)
find . -type f -mtime 3 (exactly 3 days)
find . -type f -mtime +3 (3 days or more)
find . -type f -mtime 4 (exactly 4 days)
find . -type f -mtime +4 (4 days or more)
etc.
can you provide an example for me?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello;
I have a directory that is collecting log and act files. I need to write a script that will remove these files once they are 30 days old. I have read through a number of threads on this site that have given me a great deal of information. However I have what seems to be a unique... (7 Replies)
Discussion started by: justinb_155
7 Replies
2. Shell Programming and Scripting
I am using zip -m option to zip my files, but i dont want my sub directories files to be zipped (1 Reply)
Discussion started by: skrish70
1 Replies
3. Shell Programming and Scripting
May be a simple question for experts here....
I need to get the list of files older than 30 days in the current folder. I tried "find", but it searches recursively in all the sub directories.
Can I restrict the recursive search and extract the files only from current directory ? (18 Replies)
Discussion started by: cxredd4
18 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
Request your expertise in tackling one requirement in my project,(i dont have much expertise in Shell Scripting). The requirement is as below,
1) We store the last run date of a process in a file. When the batch run the next time, it should read this file, get the last run date from... (1 Reply)
Discussion started by: dsfreddie
1 Replies
5. Shell Programming and Scripting
Hi All
I want to remove the files with name like data*.csv from the directory older than 10 days.
If there is no files exists to remove older than 10 days, It should not do anything.
Thanks
Jo (9 Replies)
Discussion started by: rajeshjohney
9 Replies
6. AIX
how do i remove sub directories of a directory and all files which are older than 7 days by a single command in AIX. pls help me.
I am using command as
#find /gpfs1/home/vinod/hpc/ -depth -type d -mtime +7 -exec rm -rf {} \;
so i want to delete all sub directories and all files from the... (1 Reply)
Discussion started by: vinodkmpal
1 Replies
7. Shell Programming and Scripting
I have a Solaris System. I am using bash shell.
I want to prepare a script which can do the below.
There are few directories i need to clean.
In those directories, I need to delete files which are older than 3 days. 3 days before files need to be deleted.
The directories are as follows.... (7 Replies)
Discussion started by: Saidul
7 Replies
8. Shell Programming and Scripting
Hello,
I need to move all the files inside /XYZ (has multi-depth sub directories) that are older than 14 days to/ABC directory but with retaining the SAME directory structure.
for example:
/XYZ/1/2/3/A/b.txt should be moved as /ABC/1/2/3/A/b.txt
I know about find /XYZ -type f -mtime +14... (3 Replies)
Discussion started by: prvnrk
3 Replies
9. Shell Programming and Scripting
Hi ,
Can anyone help me how do perform below requirement in unix.
Step1:we will receive multiple files weekly with same name(as below) in a folder(In folder we will have other files also def.dat,ghf.dat)
Filenames:
1) abc_20171204_052389.dat
2)abc_20171204_052428.dat
DON'T modify... (23 Replies)
Discussion started by: sunnykamal59
23 Replies
10. Linux
Hi,
I am trying to run a command that finds all files over x amount of days, issue is one of the directories has spaces within it.
find /files/target directory/*/* -type f -mtime +60 When running the above the usual error message is thrown back
+ find '/files/target\' 'directory/*/*' -type... (1 Reply)
Discussion started by: Ads89
1 Replies
LEARN ABOUT HPUX
uucleanup
uucleanup(1M) uucleanup(1M)
NAME
uucleanup - uucp spool directory clean-up
SYNOPSIS
time] time] time] time] string] time] system] debug_level]
DESCRIPTION
The commands, including are targeted for removal from HP-UX; see the below.
scans the spool directories for old files and takes appropriate action to remove them. Depending on the options selected, performs the
following:
o Informs the requestor of send and/or receive requests for systems that cannot be reached.
o Returns mail that cannot be delivered to the sender.
o Removes all other files.
In addition, warns users of requestors who have been waiting for a given number of days (the default is 1 day). Note that unless time is
specifically set, the default time values for the following options are used.
Options
recognizes the following options:
Any files greater or equal to time days old are removed with appropriate information to the requestor. The default time
is 7 days.
Any files greater or equal to time days old are removed. An attempt is made to deliver mail messages and execute news
when appropriate. The default time is 7 days.
Any files equal to time cause a message to be mailed to the requestor warning about the delay in contacting the remote.
The message includes the JOBID, and in the case of mail, the mail message. The administrator can include a message
line telling who to call to correct the problem (see the option). The default time is 1 day.
Any files greater than or equal to time days old are removed. The files are probably not present (if they were, the
could be executed). But, if files are present, they are taken care of by processing. The default time is 2 days.
This string is included in the warning message generated by the
option. The default string is
Other files whose age is more than
time days are deleted. The default time is 2 days.
Clean-up the spool directory for
system only. The default is to clean-up all spool directories.
The debug level is a single digit between 0 and 9.
The higher the numbers, the more detailed the debugging information returned.
This program is typically started by the script which should be started by (see cron(1M)).
WARNINGS
Use of commands, including is discouraged because they are targeted for removal from HP-UX. Use ftp(1) or rcp(1) instead.
FILES
spool directory
SEE ALSO
cron(1M), uucp(1), uux(1), uuclean(1M).
Tim O'Reilly and Grace Todino,
O'Reilly & Associates, Inc. USA.
Grace Todino and Dale Dougherty,
O'Reilly & Associates, Inc. USA.
TO BE OBSOLETED uucleanup(1M)