02-13-2002
You could use the find command to look for files modified or accessed 2 days ago and remove them. You can do a man find to get more details. Here is an ex:
syntax:
find <directory_name> -name <filename> -mtime +2 -exec rm {} \;
find /ora_export -name "exp*" -mtime +2 -exec rm {} \;
The above command looks for filenames starting with exp which were created/modified 2 days ago and removes them.
You could put it in a shell program also.
mtime means modified time
atime means access time
you could use the one applicable to you.
Hope this helps.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I want to list all files that were created since 3 month ago.
it exist a unix command to do it ?
thank you (8 Replies)
Discussion started by: yacsil
8 Replies
2. Shell Programming and Scripting
Hello all,
I would like to ask for an advice on how to deal with the following scenario.
Every now and then, our ERP system creates an interface text file with the following file format - XORD????.DLD where ???? is a sequence number. We can have 1 or more XORD files created in an hour. ... (9 Replies)
Discussion started by: negixx
9 Replies
3. UNIX for Dummies Questions & Answers
please help me with this????? :confused: :confused:
i need to create a program that will run in unix that will delete all files in a given directory that is at least 3 months old. first the program will need to automatically know what date it is right now to determine the files it will... (3 Replies)
Discussion started by: godalle
3 Replies
4. UNIX for Dummies Questions & Answers
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
5. Shell Programming and Scripting
Our nightly updates run in the evening and finish around 8am. My boss wants the current log files kept on the server for 2 days, but wants anything created before noon, 2 days prior archived. I was thinking of using touch to set a temporary file with a date of today-2 and a time of noon, then... (3 Replies)
Discussion started by: prismtx
3 Replies
6. Shell Programming and Scripting
Hi All,
Could you please let me know if there is any one can help to create a shell script to remove some files which is the created date for them greate than 10 days (sysdate-10)
Please try to email me on email removed
Thanks in advance,
Murad (1 Reply)
Discussion started by: murad_fayez
1 Replies
7. UNIX for Dummies Questions & Answers
HI,
I have 2 questions.
1>
Is there any code to see files that created some day or some time before in a directory???
2>
how or where i will find the last exit status of a process??
thanks (6 Replies)
Discussion started by: jyotidas
6 Replies
8. Shell Programming and Scripting
i want to find unix file created how many days ago? (4 Replies)
Discussion started by: utoptas
4 Replies
9. Shell Programming and Scripting
Hi,
I want to find the sum of all the files created 5 days ago and store it in a variable. (os is HP-UX)
can this be extracted from ls -l
Is there any other way of getting the sum of all the files created (4 Replies)
Discussion started by: bang_dba
4 Replies
10. UNIX for Beginners Questions & Answers
How to find a file that's modified more than 2 days ago but was modified less than 5 days ago by use of any Linux utility ? (4 Replies)
Discussion started by: abdulbadii
4 Replies
ff_vxfs(1M) ff_vxfs(1M)
NAME
ff_vxfs: ff - fast find: list file names and statistics for a VxFS file system
SYNOPSIS
num] num] inode-list] num] file] prefix] special...
DESCRIPTION
reads the inode list and directories of each special file, assuming it to be a VxFS file system, and prints inode data for files that match
the selection criteria. Output consists of the pathname for each saved inode, plus any other file information requested using the print
options below. Output fields are positional. The output is produced in inode order; fields are separated by tabs. The default line pro-
duced by is:
pathname inumber
The pathname is preceded by a dot unless you specify the generic option. The maximum information displays is:
pathname inumber size owner
The num parameter in the options descriptions is a decimal number, where means more than num days, means less than num days, and num means
exactly num days. A day is defined as a 24-hour period.
prints summary information to standard error output in addition to the report sent to standard output.
Options
recognizes the following options:
Select a file if the inode has been accessed in
num days.
Select a file if the inode has been changed in
num days.
Specify the VxFS file system type.
Generate names for any inodes specified in the
inode-list.
Do not display the inode number after each pathname.
Generate a list of all pathnames for files with more than one link.
Select a file associated with the inode if it has been modified in
num days.
Select a file associated with an inode
if it has been modified more recently than the specified file.
Add the specified
prefix to each pathname. The default prefix is dot
Print only special files and files with set-user-ID mode
(VxFS-specific option).
Write the file size, in bytes, after each pathname.
Write the owner's login name after each pathname.
Echo the completed command line, but performs no other action.
The command line is generated by incorporating the user specified options and other information derived from This
option allows the user to verify the command line.
Operands
recognizes the following operand:
special Name of a VxFS file system.
EXAMPLES
List the pathnames and inumbers of all files in the file system
Same as above, but suppress the printing of inumbers:
List files on the same file system that have been modified in the last two days displaying the pathname, inumber, and owner's user name
List all files on the same file system, including the pathname and inumber of each file, that were last accessed more than 30 days ago
Find all pathnames associated with inodes and
Execute the command on a VxFS file system
FILES
Static information about the file systems.
SEE ALSO
find(1), ff(1M), ncheck_vxfs(1M), fstab(4).
ff_vxfs(1M)