Command line stuff

Brad De Vries devriesbj at gmail.com
Wed Jan 23 19:32:58 UTC 2008


On Jan 23, 2008 2:04 PM, Sylviane et Perry White <spwhite at freesurf.ch> wrote:
> On Wednesday 23 January 2008 15:57, Donn wrote:
> > You are in a dir in a console. You have a few consoles (or tabs) open around
> > the place.  You want to move some files to another dir. You want *.jpg but
> > not "blob.jpg". You also want a few pdfs, but not all of them.
> (snip)
> This may not help you but is an introduction to my own question.
> I tried something like :
> ls | grep .jpg | grep -v blob
> That seemed to work
> (I tried "ls | grep .png | grep -v snap | grep -v ban" to remove all
> snapshot?.png and banner?.png from one of my dirs)
>
> The problem is I didn't find a method to interface that with mw or cp.
> Any tips?
>
> I'm aware this thread is not really KUbuntu specific but I would be very
> reluctant to have to adopt the "one question_one list" approach.
>
> Greetings               Perry

You could use the format:
$ mv `ls | grep ".png" | grep -v "blob"` /the/new/directory

Note the use of the backward apostrophe a.k.a. tick mark, to
accomplish the command-within-a-command.

HTH,
Brad.




More information about the kubuntu-users mailing list