Go Back   TechArena Community > Software > Operating Systems
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



How to delete files that appear in find command's output in Linux

Operating Systems


Reply
 
Thread Tools Search this Thread
  #1  
Old 24-05-2011
Member
 
Join Date: Mar 2011
Posts: 83
How to delete files that appear in find command's output in Linux
  

Hello friend, I want to delete all the files that come out in the find command's output screen. I try to use the different command but I can?t succeed to do this. Basically I want to remove this all files which has not edited in the last 8 days. This files present in /bla/ directory. I am the new person in the Linux operating system and I checked some command but I didn?t found the correct solutions. If anyone have idea about this command then please share it. I will be appreciates that knowledge.

Reply With Quote
  #2  
Old 24-05-2011
Member
 
Join Date: Nov 2009
Posts: 1,416
Re: How to delete files that appear in find command's output in Linux

There is some possibility to do this task. The Linux have to be based on the UNIX operating system. The shell prompt of this Linux OS is specially designed for performing this kind of operations Specially, executing the different command on the system. The proper command present in the Linux to perform these operations. This can be done in just one line executions. First put the find command as per the requirement. Then immediately put the –exec command and then enter the rm command to remove the find output file. This solved the trouble.
Reply With Quote
  #3  
Old 24-05-2011
Member
 
Join Date: Nov 2009
Posts: 1,035
Re: How to delete files that appear in find command's output in Linux

I also faced the same kind of trouble in the fedora OS and that time I have never idea about how to do it. Then I read the fedora user guide manual. In that one special command is mentioned. This is the xargs command. This command is useful for the build and executes standard input of the command lines. It means after using the one command and the pipe operations this previous command output can be given to the next command. Then I use the find /bla/* -mtime +8 | xargs rm * code to perform the task. It works the operations has to be done on the system.
Reply With Quote
  #4  
Old 24-05-2011
Member
 
Join Date: May 2008
Posts: 859
Re: How to delete files that appear in find command's output in Linux

I think you need to check the rm command of the Linux. The descriptions of the rm command should be providing some kind of guidance to perform these unknown operations. Then you need to just put the rm --help command on the shell prompt. Then it gives the basic information about the rm command. If any possibility related to these topics then it shows the kinds of option to perform these operations. Then I suggest you to do this task and it helps you to solve the trouble.
Reply With Quote
  #5  
Old 24-05-2011
Member
 
Join Date: May 2008
Posts: 1,020
Re: How to delete files that appear in find command's output in Linux

Try to execute the pipe command in the shell prompt. The pipe command is designed for executing the multiple commands in the single line. The output of the first command is provided as an input to the next command. Then the final command output it put on the screen. Then I just suggest you to try these solutions. It might be possible that you could build the code. This is the normal solutions and the Linux user can understand its result.
Reply With Quote
  #6  
Old 24-05-2011
Member
 
Join Date: May 2008
Posts: 962
Re: How to delete files that appear in find command's output in Linux

Hey, the solutions you mentioned for use the rm command and then use the pipe command to perform this task is not work in the Linux OS. The reason behind this is the rm command has some restrictions. In that the rm commands can?t take the standard input of the command line. It directly removes the parameter or the file name provided by it. You can check this by using the rm ?help command. This gives you the full descriptions of the rm command.
Reply With Quote
  #7  
Old 27-05-2011
Member
 
Join Date: Apr 2009
Posts: 990
Re: How to delete files that appear in find command's output in Linux

Hi. I also faced the same trouble and I want some kind of solutions which helps to execute this both find and the rm command on the single line. I use the pipe command to do this but it can?t work. Then I read some articles and there are so many codes present in that article. But most of the code can?t work. Then I try this code one by one and finally I got the correct code. I think if you have not got the correct solutions then need to search more. This helps you to execute this both command in single line.
Reply With Quote
Reply

  TechArena Community > Software > Operating Systems
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to delete files that appear in find command's output in Linux"
Thread Thread Starter Forum Replies Last Post
How to find & delete duplicate files in Apple Mac OSX Acardi !! Windows Software 10 30-04-2013 03:02 PM
Where can I find Quarantine files in Windows 7, and how can I delete them? Conquers Networking & Security 3 06-06-2011 11:13 AM
Bash command to delete entire Files from folder Strangers Windows Software 4 11-11-2010 09:30 PM
Download files from Linux command line chaosblade Operating Systems 3 28-08-2009 03:18 PM


All times are GMT +5.5. The time now is 08:08 PM.