On 12 Feb 2012, at 15:27, FRank Murphy wrote:
> On 12/02/12 15:22, Niall O Broin wrote:
>> 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
>>>> Yes that it, plain text files accumulated from lost of trial and error testing. With plenty of the error.
If that's the case, you're going to have to provide find with some means of distinguishing between the files you want, and files you don't want. Either by name, or by size, or by when modified, or owner, or any of the other things that find can query about a file - man find for lots of details.
Niall
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!