LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] rm help\guidance needed.

[ILUG] rm help\guidance needed.

Niall O Broin niall at linux.ie
Sun Feb 12 15:22:25 GMT 2012


On 12 Feb 2012, at 15:00, FRank Murphy wrote:

> http://serverfault.com/questions/195005/linux-svn-how-to-remove-all-versioned-files-but-keep-directory-structure-ign
> 
> Similar to above link.
> 
> Want to delete the files only in _local (plain text files)
> keeping all others and dirs above and below _local.
> 
> find dir/ -path '/nfs/yum/x86_64/16/_local' -prune -o -type f -exec rm {} +

You're really going to have to restate your requirement more lucidly. What you described (or my understanding thereof) isn't much like what you linked above. Do you want to remove all files under a particular directory e.g. /nfs/yum/x86_64/16/_local in which case 

find /nfs/yum/x86_64/16/_local -type f -exec rm {} \;

or variants involving xargs or $() will do the trick. Or do you want something else entirely? You mentioned 'plain text files' - do you want to only delete a particular class of file?



Niall



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell