Home arrow Wiki arrow Search and delete files in Unix
Main Menu
Home
Help Docs
Newbies
Corporates
Gnu/Linux Distros
Programming
Databases
Links
Search
Regular
News
Interviews
Aaj Ka Tip
Aaj Ka Command
Community
Blogs
Wiki
Forums
Services
Free Software

Search and delete files in Unix Print E-mail
This is a useful tip to find and remove some files by searching recursively in a directory and sub directories

This will list down all the *.tmp/*.log files
 find . -type f -name "*.tmp" -exec echo {} \;
 find . -type f -name "*.log" -exec echo {} \;


This will delete down all the *.tmp/*.log files
 find . -type f -name "*.tmp" -exec rm {} \;
 find . -type f -name "*.log" -exec rm {} \;


It will be better to list the files first and then delete them, so that we do not miss out any important file
< Previous   Next >



gnulinuxclub
Join Us
About Us
Contact Us
Support Us
Acknowlegdement
Login(only for dev.)

Royalty Free Images

O'Reilly User Group discount!




Powered By GIMP GIMP
Contact Webmaster Copyleft 2011 gnulinuxclub.org