FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 01-01-2012, 11:56 AM
Frank Murphy
 
Default using rm *.rpm but keep some files?

I'm trying to remove rpms from my local repo.
But keep some named files.

Would this work:
find /path/to/repo/*.rpm | grep -v "foo* bar*" | rm *.rpm

--
Regards,

Frank Murphy--exclude
UTF_8 Encoded
Friend of fedoraproject.org
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 01-01-2012, 12:10 PM
Theodore Papadopoulo
 
Default using rm *.rpm but keep some files?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/01/2012 01:56 PM, Frank Murphy wrote:
> I'm trying to remove rpms from my local repo. But keep some named
> files.
>
> Would this work: find /path/to/repo/*.rpm | grep -v "foo* bar*" |
> rm *.rpm
>

Make it

find /path/to/repo/*.rpm -print | grep -v "foo* bar*" | xargs rm

and that should work (not tested).



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8AWygACgkQEr8WrU8nPV3VVwCffrLira39DW 1Vd2SnBG53fpq2
IhMAoJ/E63tziMdol5WQZD2gQAoCKnjR
=t64t
-----END PGP SIGNATURE-----
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 01-01-2012, 12:12 PM
Andras Simon
 
Default using rm *.rpm but keep some files?

2012/1/1, Frank Murphy <frankly3d@gmail.com>:
> I'm trying to remove rpms from my local repo.
> But keep some named files.
>
> Would this work:
> find /path/to/repo/*.rpm | grep -v "foo* bar*" | rm *.rpm

I don't think so. But you can always try in a "sandbox". And while
there are probably a thousand clever ways to do it on the command line
(probably even with find alone), if it's a one-off thing, I'd just
mark all files with 't' in emacs' dired, unmark ('u') the ones to
keep, and then remove the rest ('D'). I'm sure any other file manager
could be used instead of dired.

Andras
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 

Thread Tools




All times are GMT. The time now is 09:29 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org