[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