No more .rej-s and .orig-s

Why on Earth one wants a blog if he can’t write down there that damn command that you always forgot (either entirely, or when it comes to some syntax detail, or parameter ordering, or …) ?

So, here we are, the fist post of this kind, a.k.a.:

How to remove all those .rej and .orig files, resulting from days of applying and rebasing patches, that are cluttering the output of your grep-s with stale content?


well, like this:

$ find . \( -name *.rej -or -name *.orig \) -exec rm -f {} \;

Yes, this was a really easy one, but everyone I try to remember it, that damn \; always drive me crazy. Well, not anymore (o so I hope).

About dariofaggioli

Interested in CS, programming and Open Source since like forever, I'm now a very happy Xen developer, and Citrix is from where I get my paycheck. Much more important, I am a dreamer, a madly in love husband and an enthusiastic & incredibly proud father.
This entry was posted in Linux, Technology and tagged , , , , , , , . Bookmark the permalink.

2 Responses to No more .rej-s and .orig-s

  1. Juri Lelli says:

    Thanks for this!

    BTW, I usually do something like:
    $ find . -name *.rej | xargs rm

    Cheers!

    • Mmm… A lot better, mainly because it’s shorter (and thus easier to remember), and also more “Unix style”, as it takes advantage different programs connected by ‘|’-s etc., etc., etc. Personally, I hate xargs. Really, I truly and deeply hate it… But I understand that’s something irrational about me, so yeah, go ahead with that and thanks for sharing!🙂

Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s