[Novalug] Text User Interface (TUI) utilities for Linux and Windows -- WAS: Messed up file title problem
Bryan J. Smith
thebs413 at yahoo.com
Sun Mar 21 11:51:09 EDT 2010
Jon -- great post. I like it when people clarify things after the
posts of others, including myself, offer alternative logic and approaches,
things some of us either assume or didn't think of offering.
With that said, and at the risk of introducing yet another tangent,
maybe it's time I bring up the concept of Text user Interfaces (TUIs)
for Linux and Windows -- ideally those available for both.
Personally I'm lazy. I don't use Linux because I want to tinker much.
The only time I do is when I just can't ignore my itch any longer. But
for the most part, I don't. In fact, I even avoid the command line
regularly.
E.g., 90% of what I use my netbook running Fedora for is just to
get images
--- On Sun, 3/21/10, Jon LaBadie <novalugml at jgcomp.com> wrote:
> From: Jon LaBadie <novalugml at jgcomp.com>
> Subject: Re: [Novalug] Messed up file title problem
> To: novalug at calypso.tux.org
> Date: Sunday, March 21, 2010, 3:37 PM
> On Sun, Mar 21, 2010 at 12:55:45AM
> -0400, cmhowe at patriot.net
> wrote:
> > > On Saturday 20 March 2010 10:36:25 pm cmhowe at patriot.net
> wrote:
> > >> > List,
> > >> >
> > >> > This doesn't really affect the problem I
> am wrestling with, but it is
> > >> an
> > >> > annoyance and I want to deal with it.
> > >> >
> > >> > I inadvertently put a space in any oo
> word processor file. It reads
> > >> > Trial 1.odt. How do I get rid of it?
> > >> >
>
> Charlie,
>
> Both times I've been to your home you have shown me a large
> book,
> the linux shell bible I think. And said you were
> going to start
> to read it and experiment with its examples and exercises.
>
> Now would be a good time to do so. And don't be
> surprised by
> this problem. One of the most common queries from
> actual newbies
> (as opposed to you, the "perpetual newbie" :) is exactly
> yours,
> "how do I remove ...".
>
> As to removing the file, there several possibilities and
> here is
> a partial summary of what's been suggested to remove the
> file.
> I'm assuming you do not want the data. Otherwise we
> should be
> talking about copying (cp) or renaming (mv) the file.
>
>
> If you know the exact character, use quotes, (single or
> double
> quotes work here) eg.
>
> rm 'Trial 1.odt'
>
> But, the space could be two spaces or a tab in which case
> the
> above rm would say no such file. And there could also
> be other
> characters in the name that you can't see. For
> example a space
> at the start or end, or a control character.
>
>
> An alternative is wildcards, all we really need here are *
> for
> any string and ? for one character. BUT
> CAUTION!!! As Peter
> (and others I forget) said, when you use wildcards you
> risk
> acting on multiple matches. For example "rm
> Trial*1.odt"
> (use no quotes) should match your problem file. But
> it will
> also match these names:
>
> Trial 1.odt
> # the one you want
> Trial 1.odt
> # two, not one space
> Trial21.odt
> # an extra digit, not a space
> Trialx1.odt
> # an extra letter, not a space
> Trial1.odt
> # nothing instead of a space
>
> So you can see wildcards could remove lots of things you
> did
> not intend to remove.
>
> If you want to use wildcards, and many of us do, test it
> first
> with a command that does not change anything. I
> suggest "ls -1".
> That is a "dash one", not "dash ell". This will force
> the ls
> command to list file names in one column, i.e. one per
> line
> basically. So you could try this and get the right
> result:
>
> $ ls -1 Trial*1.odt
> Trial 1.odt
> $
>
> i.e. only one name listed before the next shell prompt,
> you can safely replace "ls -1" with "rm". But if you
> get
> something like:
>
> $ ls -1 Trial*1.odt
> Trial 1.odt
> Trial21.odt
> $
>
> do not use that particular wildcard. Find a
> different
> wildcard scheme or use a different remove method.
>
>
> When you are unsure about your remove command, use the
> interactive option, "-i" (dash eye). This will show
> you each file, one at a time, and ask for confirmation
> (y or n) to allow remove to delete the file. In my
> last example above there were two matching files, with
> "rm -i" you would get something like:
>
> $ rm -i Trial*1.odt
> rm: remove regular file `Trial
> 1.odt'? # type y
> rm: remove regular file
> `Trial21.odt'? # type n
> $
>
> The blunderbuss approach would be "rm -i *". This
> would
> work if you are careful, but it is very prone to errors.
> I made a big one once when I put a space between the
> dash and the eye (rm - i *). It told me no file
> named
> "i" existed and removed everything else (which I didn't
> want to happen).
>
>
> Finally as was suggested, you already know how to delete
> files from the GUI interface. For real work fall
> back
> on that knowledge. Go into the file manager and move
> the icon to the trash can. Or right-click the icon
> and
> select "delete" or "move to trash". Then you can get
> on with your real work and still extend your knowledge
> by asking the list or looking it up in the shell bible.
>
> jl
> --
> Jon H. LaBadie
> jon at jgcomp.com
> JG Computing
> 12027 Creekbend Drive
> (703) 787-0884
> Reston, VA 20194
> (703) 787-0922 (fax)
> _______________________________________________
> Novalug mailing list
> Novalug at calypso.tux.org
> http://calypso.tux.org/mailman/listinfo/novalug
>
More information about the Novalug
mailing list