ID computer

From: liste_at_artware.qc.ca <(liste_at_artware.qc.ca)>
Date: Wed May 23 11:55:09 2001

On 23-May-2001 John Foust wrote:
> At 07:32 PM 5/22/01 -0700, Sellam Ismail wrote:
>>Like selecting multiple items, then dragging and dropping them. Well,
>>it's easier at least. Otherwise, I can do everything faster in a
>>command line.
>
> OK, let's race. I think it's easy to think of counter-examples,
> even though I'm a fan of command-line power in the right situation.

Assuming unix:

ls >something
vi something # now you go through and remove the files you want to keep
rm `echo something` # echo something | xargs rm

The longest step by far is the "vi something" to weed out the files you
want, which is pretty much the same as ctrl-clicking, and less error prone
(see below). Note, also, that something will contain "something" (at
least it does on gnu/linux and bash) so it cleans itself up.

> Given a folder full of 100 documents with long, human-friendly
> filenames with no relevant pattern involving strings of characters
> or dates, delete a given random set of 50 of those files. I'll use
> any windowing system, you'll use 'del' or 'rm'. I think an extended
> select (via CTRL) and a drag to the trash would win on either Mac or
> Windows, don't you?

Only if you don't mess up and release the ctrl key at some inoportune
moment, there-by requiring you reselect everything. Also, average users
(as opposed to advanced) don't know that ctrl-click allows them to select
multiple items.

> While 'rm' might have an interactive "yes/no" option, which
> other command-line tools have it? Sure, you can write anything
> in a script...

Creative use of `xargs -n 1 -p` will add this capability to any other
command. [1]

Now, before you think I'm a command-line bigot, I should point out that
this level of prowess and speed is pretty much reserved for the hard core
geeks and that GUIs are probably much simpler for the average user.

-Philip

[1] "The xargs utility shall conform to the Base Definitions volume of IEEE
Std 1003.1-200x, Section 2." [2] But i don't know if -n or -p are GNU
extentions

[2] POSIX [3]

[3] Since when does classiccmp have ASR-style footnotes?
Received on Wed May 23 2001 - 11:55:09 BST

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:34:09 BST