Featured post

Top 5 books to refer for a VHDL beginner

VHDL (VHSIC-HDL, Very High-Speed Integrated Circuit Hardware Description Language) is a hardware description language used in electronic des...

Saturday, 18 May 2013

Linux/Unix - Search and remove files with one find command on fly

Some time it is necessary to find out files and remove them as we need to do today. However, rm command does not support search criteria.

However, with find command you can search for files in a directory and remove them on fly.

You need to combine find and rm command together.

Fortunately find command makes this operation quite easy.

You can use find command as follows:

find . -type d -print | grep <file_name/dir_name> | xargs -n1 rm -rf

Get free daily email updates!

Follow us!

No comments:

Post a Comment

Please provide valuable comments and suggestions for our motivation. Feel free to write down any query if you have regarding this post.