LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-26-2001, 10:19 AM   #1
ascii2k
Member
 
Registered: Dec 2000
Location: Indiana
Distribution: Red Hat 7.3/Mandrake 8.2/9.0
Posts: 154

Rep: Reputation: 30
Removing files


How would it be possible to remove a list of files contained in a seperate file.

i.e. I use the find command to create a list of files and send the list to a text file. I then want to remove the files in that list.

I tried the standard 'rm -rf < file' but that doesn't do anything. is there a different command that I dont know about?


Thanks
 
Old 11-26-2001, 11:02 AM   #2
d3funct
Member
 
Registered: Jun 2001
Location: Centralia, WA
Posts: 274

Rep: Reputation: 31
Why not just use the 'find' command to find the files and then use the -exec flag to remove them once found instead of writing the list to a file?

find . -type f -mtime +3 -exec rm -rf {} \;

That would remove all files of type "file" (as opposed to directory) with a modification date of more than 3 days.
 
Old 11-26-2001, 11:20 AM   #3
ascii2k
Member
 
Registered: Dec 2000
Location: Indiana
Distribution: Red Hat 7.3/Mandrake 8.2/9.0
Posts: 154

Original Poster
Rep: Reputation: 30
-exec

Thanks! That -exec is what I was looking for. I still need the list of files because I am making a tar archive of them also but I can do the -exec once the tar is finished.
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
removing files kjs Linux - Software 1 02-17-2005 02:18 PM
removing fglrx files? ryedunn Linux - Hardware 1 01-17-2005 12:21 PM
Removing files wihtout removing containing Direcotry caps_phisto Linux - General 2 10-07-2004 08:16 AM
Removing Temporary Files coolamit78 Linux - General 5 09-17-2003 03:40 PM
removing files in /tmp sakeeb Linux - General 4 06-09-2002 12:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:50 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration