top | item 2967893

Miguel de Icaza: Learning Unix

217 points| alexkay | 14 years ago |tirania.org

123 comments

order
[+] foob|14 years ago|reply
I would like to add the Advanced Bash-Scripting Guide (http://tldp.org/LDP/abs/html/) as an incredible resource. It's obviously geared towards scripting but most of what it teaches is extremely useful for working in an interactive shell as well. I had been using linux and bash for years before I read it and I still picked up quite a bit when I finally got around to working through it.
[+] gecko|14 years ago|reply
The only thing I don't quite grok is that, as the complexity of a given bash script increases, it moves ever-closer to looking exactly like the well-written-by-90s-standards Perl I remember from when I was just learning Unix.

Given that Perl's about as ubiquitous as bash (and arguably more so, since I literally don't know any mainstream *nix that ships without Perl in the core, and I know several that ship without bash), why not just use Perl in the first place? This is exactly what it was designed to do well, back in the beginning.

[+] Adaptive|14 years ago|reply
Agreed. The string operations alone are, while not sed level awesome, pretty amazing. Also, indirection, in bash, is pretty useful. ${prefix_*} is nice to have around.
[+] dramaticus3|14 years ago|reply
"Nobody really knows what the Bourne shell's grammar is. Even examination of the source code is little help."

— Tom Duff

[+] sb|14 years ago|reply
Hm, instead of MC I prefer dired+ within Emacs, I have never used anything more powerful than this (particularly with TRAMP and the regex features.) So, if you are already learning Emacs, I think it pays off to at least take a look at dired(+).

(Minor remark: for smaller tasks [and instead of launching a terminal window] I prefer to use the DirOpus clone "worker" on UNIX.)

[+] gradstudent|14 years ago|reply
Does anyone else find it deliciously ironic that, in such a pro-Unix article, Miguel recommends Mavis Beacon? According to Amazon, it's available only for Windows and OSX :p
[+] skb_|14 years ago|reply
I'm surprised he didn't recommend gtype, it's probably the best and fastest way to learn how to type in that there are no unnecessary graphics and you need not ever touch a mouse. Fits the Unix approach much better imo.
[+] spiffytech|14 years ago|reply
I had to spend several years in Middle School with Mavis Beacon and it didn't do anything for my typing abilities. When I was done with my computer classes I still couldn't hit 35 WPM.

Then I picked up computers as a hobby. With all the random typing I did as part of the hobby I quickly found myself in the 70-100 WPM range.

You don't really need a typing tutor program with its learning modules and fluff. You just need to spend time typing. I recommend printing out a color-coded image[1] of a keyboard that shows which fingers to use for which keys and just spending a little time on http://typeracer.com every day trying to stay on home row and follow the color guide.

[1] http://www.tranexp.com/win/05_Finger-placement.jpg

[+] shaggyfrog|14 years ago|reply
I still have my copy of UNIX for the Impatient I bought in 1997 and I still find myself referring to it occasionally (less so these days, with Internet references being more accessible generally). Quite a thing for that book to stand the test of time so well to still find it recommended -- 1995 edition and all. The C equivalent would probably be Advanced Programming in the UNIX Environment.
[+] RyanMcGreal|14 years ago|reply
I loved this:

> Save yourself the embarrassment, and avoid posting on the comments section jwz's quote on regular expressions. You are not jwz.

[+] juiceandjuice|14 years ago|reply
Are most people not touch typers? I've noticed my boss isn't really a touch typer, despite programming since before I was born, but I always assumed the majority of CS people were.
[+] hendi_|14 years ago|reply
I'm a touch typer, but not in the standard sense. I don't look up the keys while writing and use most of my ten fingers, but I don't use them like it's taught in touch typing. I know exactly where all the keys are and I intuitively press them with some fingers depending on which is nearest or easiest at the specific moment. According to [1] I can easily type faster than 600 keys per minute, more than all other people I know.

I don't think I should learn touch typing to further increase my typing speed. Right now most of the time my pondering over coding problems is limiting my typing speed, not my ability to move my fingers.

But maybe it's worth learning touch typing to reduce the stress on the fingers and be more egonomic?

[1] http://speedtest.10-fast-fingers.com/

[+] bitops|14 years ago|reply
You'd be surprised how many senior-level people are hunt and peck typers. I've met several software engineers with 10+ years of experience who don't type with all 10 fingers (assuming they have that many).
[+] kmm|14 years ago|reply
I can touch type in the sense that I don't look at my keyboard when I type, yet I don't really use ten fingers. I was never properly taught to type.

Coincidentally, I'm trying to learn real touch typing as I think it could help me in Vim.

[+] robryan|14 years ago|reply
I don't think that you really have to be, I think it helps less than in regular writing.

Personally my style is very anti touch, using 2 fingers for the majority of letters, which I don't have to look at the keyboard for but I probably take more glances at it that a touch typist. I think though in being proficient in navigating the symbols on the keyboard mostly makes up for the loss in outright English typing speed.

[+] super_mario|14 years ago|reply
I'm always shocked to see a developer not touch type. I just can't understand those 10% or so, that spend their life essentially editing text and yet can't touch type. It's one of those essential skills that you learn once and reap the benefits for the rest of your life.
[+] LeafStorm|14 years ago|reply
I need to remember this one: "And you will offer to buy me a beer, which I will refuse because I rather have you buy me a freshly squeezed orange juice."
[+] tingletech|14 years ago|reply
in a computer lab between pepper canyon and warren college at UCSD in 1991 it was written to type 'man man' and maybe even 'apropos' was written up there on a chalk board. I taught myself unix from the manual. A few years later, I learned perl starting with 'perldoc perldoc'.
[+] flatwhatson|14 years ago|reply
In all my years of using and loving (and abusing) the shell, I've never encountered apropos. I'm really amazed that something so fundamental has somehow been left out of the many unix/shell articles (such as this one) that I've read. Anyhow, you've made my day. Thanks!
[+] sciurus|14 years ago|reply
He's right when he says Unix Power tools "is the atomic bomb of Unix knowledge".
[+] dmboyd|14 years ago|reply
Mavis beacon teaches typing.. Seriously?
[+] thristian|14 years ago|reply
Well, I guess there's no memetically famous touch-typing tutorials software for Linux or Mac.

In fact, the only other memetically famous touch-typing software I know of is Typing Of The Dead¹, and that's not exactly widely-available.

¹: http://en.wikipedia.org/wiki/The_Typing_of_the_Dead

[+] andrewhare|14 years ago|reply
He sounded pretty serious to me. Do you have a better suggestion? The Mavis Beacon software does a perfectly fine job at teaching touch-typing.
[+] initself|14 years ago|reply
I did MBTT version 1.0 either on Dos or Win 3.1 (can't remember) when I was like 9 years old and I am currently the fastest typist I know.
[+] kasperset|14 years ago|reply
Another good book with historical perspective. Harley Hahn's Guide to Unix and Linux
[+] pointyhat|14 years ago|reply
Without starting a religious war, it's essential to learn the basics of vi for it is ubiquitous on all UNIX variants. Even if you use emacs, it's essential knowledge.
[+] davidw|14 years ago|reply
While this argument might have held weight once, I think these factors undermine it:

Emacs used to be considered 'expensive' in terms of disk/memory. These days, it really isn't.

Non-Linux unixes are less and less of a factor these days, and even most of those have some sort of packaging system where installing emacs is a quick operation, rather than a laborious download/compile/install.

Emacs itself has remote editing capabilities with Tramp, via ssh that obviates the need to fire up an editor on the target machine in some cases.

If your job involves sitting down at HPUX/Irix/AIX/whatever machines that haven't been updated since 1998, and don't allow remote access, yes, vi is probably a valuable skill. Otherwise, I think this argument is less important than it once was.

[+] larsberg|14 years ago|reply
Indeed. As part of my PhD duties, I've been the lab tutor for the first serious UNIX/systems programming course for the last three years, and I always teach vi:

ESC : q!

Because you never know when some commandline tool is going to drop you into vi (I teach them about the EDITOR variable, but sometimes you ssh somewhere and, you know...), and you need to know how to get out.

True story: the number one cause of issues with source code control systems is a vi session that the students accidentaly opened, managed to flee from with C-z, and didn't realize was still around with an open file holding the subversion lock and preventing them from committing their source code. I'd say I got 5-10 a quarter (~60 students in each quarter's session).

[+] josteink|14 years ago|reply
Why? vi and its derivates has their own (weird) usage-convention which you will find in no other software anywhere on the planet. Learning them gives you very few transferable skills.

Any "Unixy" thing you have around these days will have more resources than most computes did in the mid 90s, and the need for a "lightweight" editor like vi is much, much smaller now than it was back then. Even my Buffalo router has nano.

For most Linux distros you install, you typically have nano, pico, joe, jedit or emacs or lots of other editors which (apart from emacs which is its own universe) largely follows the same conventions and at large gives transferable skills. These are IMO much more useful to know.

Why should I bother learning an archaic, non-standard editor from an era when "line-editors" were considered bloated? Why should it even be considered "relevant" today? Even more so, why should it be considered "essential"?

I really don't agree and I really don't see why vi-users insist everyone need to learn their favourite editor.

[+] sixtofour|14 years ago|reply
Reply to above, and siblings.

FTA: "If you learn to use Emacs, you will automatically learn the hotkeys and keybindings in hundreds of applications in Unix."

His point here is not to learn Emacs because it's a good editor, but because the keystrokes transfer to "hundreds of applications in Unix."

Which is true enough. In the (bash etc) shell you can change that to vi keystrokes with set -o vi, and you can change the behavior of those hundreds of applications (like mysql, e.g) by having a .inputrc file, but by default, lots of those apps use emacs keystrokes.

Use whatever editor you want, for whatever reason you want. His suggestion is worth considering, for the reason he states.

[+] archivator|14 years ago|reply
I'd especially like to point out that vi is the de facto editor in embedded Linux installs, since it comes with busybox. Unless you want to constantly shuffle files around between your machine and the embedded one, you just have to learn vi.
[+] chalst|14 years ago|reply
ed/ex is well worth learning. The other vi commands are less so, unless you prefer to use vim as your main editor.

If you are a vim power user, finding yourself using traditional BSD vi is likely to be an unpleasant experience, making the vim is great because vi is installed everywhere weak as an argument.

[+] seewhat|14 years ago|reply
Anecdote here...

While I find myself using Emacs more that Vi/Vim these days, I still find Vi key-bindings useful in the less(1) pager, which I use extensively.

I've just discovered that less responds to Emacs movements, but for searching text I rely on the vi slash. Secondly, when navigating multiple files in less, the vi/vim "next/prev file/buffer" commands (n/p) apply.

[+] ryanklee|14 years ago|reply
> Without starting a religious war

Famous last words ;-)

[+] jrockway|14 years ago|reply
Why? vi isn't even the default editor on many Linux distributions anymore.
[+] dramaticus3|14 years ago|reply
cough ed cough

though you wont find either on your fresh gentoo install

[+] gcb|14 years ago|reply
learn unix ... use midnight commander.

lolwat?

[+] jrockway|14 years ago|reply
Keep in mind that the same person wrote both this blog post and Midnight Commander.