LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-02-2007, 01:10 AM   #1
acwbrat
LQ Newbie
 
Registered: Oct 2007
Posts: 22

Rep: Reputation: 15
Unhappy Why I am not figuring the delete.sh bash script?


I have been trying to figure out a script that delete a file that hasn't been used in the directory. I have found a code but I am still not understanding.

Here's the piece that I have been studying:

find -mtime +3 -exec rm {}
 
Old 11-02-2007, 01:37 AM   #2
imagineers7
Member
 
Registered: Mar 2006
Distribution: BackTrack, RHEL, FC, CentOS, IPCop, Ubuntu, 64Studio, Elive, Dream Linux, Trix Box
Posts: 310

Rep: Reputation: 30
Hi acwbrat,

This is what you wrote:
Code:
find -mtime +3 -exec rm {}
It should be like this:
Code:
to remove without asking again:
find -mtime +3 -exec rm -f {} \;                    (observer \;)
prompt before deletion:
find -mtime +3 -ok rm {} \;


Hope, this helps you,



Aniruddha

Last edited by imagineers7; 01-06-2008 at 09:19 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
BASH Need help figuring out how to loop SELECT statement mcdrr Programming 2 05-08-2007 04:47 AM
bash script to delete files c0d3 Programming 9 12-05-2004 10:45 PM
why did bash 2.05b install delete /bin/bash & "/bin/sh -> bash"? johnpipe Linux - Software 2 06-06-2004 06:42 PM
delete all .bash* swmok Linux - Software 2 12-01-2003 09:17 AM
Figuring out yesterday's date within a script chrisk5527 Linux - General 1 02-04-2003 04:47 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration