Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 09-12-2005, 06:49 AM   #1
Registered: Jun 2003
Distribution: Arch -
Posts: 186

Rep: Reputation: 30
remove a folder created 3 days ago.


I have to remove a folder, who has been created a three days can do this with a bash script? or something like that...?
Old 09-12-2005, 07:45 AM   #2
Bruce Hill
HCL Maintainer
Registered: Jun 2003
Location: McCalla, AL
Distribution: Gentoo / Funtoo
Posts: 6,926

Rep: Reputation: 126Reputation: 126
Gosh, I hope I'm not missing something here, but why not issue:
rm -rf <directory>
Old 09-12-2005, 08:23 AM   #3
Registered: Sep 2005
Location: UK
Distribution: Ubuntu 12.04 LTS
Posts: 76

Rep: Reputation: 16
Originally posted by Chinaman
Gosh, I hope I'm not missing something here, but why not issue:
rm -rf <directory>
The -r switch (recursive) is needed when removing directories
The -f switch (force) removes without asking separately about each file.

typing 'man rm' will tell you all about it.
Old 09-12-2005, 10:39 AM   #4
LQ Newbie
Registered: Sep 2005
Location: Romania/Bucharest
Distribution: Ferdora Core 3
Posts: 7

Rep: Reputation: 0
Well, rm will work in such cases, but I think his problem was finding the directory created 3 days ago.
The command appropriate for that is find, switches -mtime and -type will enable you to find the directory created/modified 3 days ago
Old 10-17-2005, 11:15 AM   #5
Registered: Jun 2003
Distribution: Arch -
Posts: 186

Original Poster
Rep: Reputation: 30
i found the solution:

find /directory/* -type f -mmin +2800 -exec rm {} \;
-type f -> delete only the regular file's
-mmin +2800 -> File's data was last modified 2800 minutes ago.

thanks for all help


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
How to get rid of the no name folder created by Open Office? Linux.tar.gz Linux - Software 8 09-27-2005 02:39 PM
Uninstall or Remove Folder? sall Linux - General 4 08-07-2005 11:35 AM
Linux won't write to a Windows-created folder joshknape Linux - Newbie 6 07-25-2005 10:05 PM
Remove folder and file os2 Programming 1 03-12-2005 02:12 PM
I have 8 character file name, no extension files being created in my dbaseIII+ folder bonzo Linux - General 2 01-22-2004 06:49 AM

All times are GMT -5. The time now is 06:47 PM.

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