[conspire] Netzero/Breezy Badger

Daniel Gimpelevich daniel at gimpelevich.san-francisco.ca.us
Thu Jan 12 14:09:03 PST 2006


It should be noted that none of the following will work in this specific
situation, because the currently running non-root shell isn't supposed to
be able to see inside the home directory of any other user, such as root.

On Thu, 12 Jan 2006 13:40:51 -0800, Rick Moen wrote:

> However, there's a larger issue, here:  You actually don't need to
> _type_ those quotation marks.  In fact, the fact that you encountered
> that error reveals something important you REALLY need to know.  This is
> something that I need to include in the "I installed Linux.  Now what?"
> tutorial I keep meaning to write:
> 
> The bash shell, like all good shells, does filename completion.  You
> _must, must, must_ train your mind/fingers to USE it.  This is something
> I see almost all new Linux or BSD users stumbling over, and it's
> frustrating to watch, because I know how much better their lives will
> be, once they get it right.
> 
> I can tell, from what happened, that you must have typed that entire
> command line, from beginning to end, complete file path and all, before
> pushing Enter and seeing .  You _must_ learn to stop doing that.
> 
> Instead, you type one or two letters of a directory or filename, and hit
> Tab.  Keep your eyes on the screen, and see if the directory or filename
> automagically completes on your command line.  That is, you type
> 
>   $ cp ./ro
> 
> ...and hit Tab.  The screen immediately updates to
> 
>   $ cp ./root/
> 
> ...because the shell has figured out that the only possible qualifying
> subirectory is "root", and therefore supplied the remaining letters.
> Now, you continue to type, on the same uncompleted command line:
> 
>   $ cp ./root/D
> 
> ...and hit Tab.  The screen immediately updates to
> 
>   $ cp ./root/Desktop/
> 
> ...because the shell has figured out that the only possible qualifying
> subirectory is "root/Desktop/".  Now. start typing again:
> 
>   $ cp ./root/Desktop/N
> 
> ...and hit Tab.  The screen immediately updates to
> 
>   $ cp  "./root/Desktop/Netzero Internet"
> 
> Notice that the shell has retroactively gone back and prepended an
> opening quotation mark?  The shell is talented.  The shell is your
> friend (except when you tell it to do dumb things).  Use the shell:  
> The shell will save you an _immense_ amount of typing, and also will
> prevent you from ever, ever, EVER seeing "file not found", ever again.
> 
> If you _had_ trusted to the shell and used it for filename completion, 
> you would not have encountered the error you did.  Thus the moral of my
> story.
> 
> Note:  There are fine points to filename completion.  If there had been 
> also a "root/Dave" file, then typing 
> 
>   $ cp ./root/D
> 
> ...and then Tab, would not (immediately) have impelled the shell to
> automagically fill out your command line to "cp .root/Desktop", because
> of the ambiguity.  Instead, it would fail to act.  _However_, if you
> then hit Tab a second time (as in, I _really_ want you to complete that
> name for me), it would display the matching choices, like this:
> 
>   Desktop/  Dave
> 
> You can then disambiguate by typing on additional letter:
> 
>   $ cp ./root/De
> 
> ...and then Tab.  The shell now has only one possible candidate, having
> ruled out "Dave", and so updates your partial command line:
> 
>   $ cp ./root/Desktop/
> 
> 
> People who see me helping a new user who's typing commands at a shell
> prompt will often see me saying "Hit Tab!  Hit Tab!" and reflexively
> punching down my left hand, out of sheer frustration.  ;->




More information about the conspire mailing list