Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


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

Rep: Reputation: 15
Unhappy Why I am not figuring the 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
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:
find -mtime +3 -exec rm {}
It should be like this:
to remove without asking again:
find -mtime +3 -exec rm -f {} \;                    (observer \;)
prompt before deletion:
find -mtime +3 -ok rm {} \;

Hope, this helps you,


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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

All times are GMT -5. The time now is 04:38 AM.

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