| | |
Help in writing a shell script
![]() |
•
•
Join Date: Oct 2007
Posts: 399
Reputation:
Solved Threads: 47
Hey There,
You should be able to do this just by using "find"'s -mtime option
That will check all the files in /directory/
Hope that helps
, Mike
You should be able to do this just by using "find"'s -mtime option
Shell Scripting Syntax (Toggle Plain Text)
find /directory/ -mtime +7 -exec rm {} \;
That will check all the files in /directory/
Hope that helps

, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
![]() |
Similar Threads
- Need help writing a shell script to do the following: (Shell Scripting)
- how to return value from shell script to the calllin C program (C)
- I need full guide of writing c shell script (Shell Scripting)
- Shell Script for Load monitoring! (Shell Scripting)
- exiting the shell within a shell script (Shell Scripting)
- Shell Script Issue (Shell Scripting)
- Linux Shell Script needs help writing program (Shell Scripting)
- Linux Shell Script (Shell Scripting)
- Shell script for identifying FS TYPE and mounting via LOOP device (Shell Scripting)
Other Threads in the Shell Scripting Forum
- Previous Thread: need help in this
- Next Thread: Killing of a process and send a mail if the process doesnot come up within 2 minutes
| Thread Tools | Search this Thread |





