Tips, Wisdom, and Advocacy...

on this page i try to transcribe many of the more useful things i have learned computing. small easy things that make a big difference. most of the tips apply to Unix with a strong emphasis on free utilities and the GNU tools. in fact that is my first tip. never underestimate free software. if you find something is more difficult than you know it should be then chances are someone else did too, solved the problem and gave away the solution. (after all, wouldn't you?)

Shells (zsh)

your shell is what you interact with whenever you want to get something done, knowing your shell can save you alot of time and heartache. backquotes. a backquoted expession will be run and the output will be palced on the command line like so ls -al `which sh` would be the same as ls -al /bin/sh aliases: the syntax may vary for different shells but aliases may be used to make one thing expand into something else. some useful aliases are:

The shell I normally use is zsh and i HIGHLY recommend it, it is free and very powerful.. these next few things only work in zsh. there are a whole slew of options in zsh perhaps the most useful one I find is AUTO_CD you turn it on with setopt autocd (this can be placed in your .zshrc) with that turned on you can switch directories just by typing the dir name as if it were a program. ie you can type .. or /home and go there instantly. I know it only saves 3 keystrokes but they add up.. see the zsh man pages for more autocommands. Another zshism dealing with directories is cd - which will switch to the directory you were just in, this is just one of the most useful features. unlike pushd/popd it is always on. useful whenever you need to switch to another dir for just a sec to make a change.

=executable (ie. =ls, =perl or =texi2html) expands to `which executable` (those are backquotes) this is perhaps the most common use of backquotes and a great shortcut for it. useful for ls -al =perl (see the permissions on perl without checking if it is /usr/bin or /bin or wherever first) or something like less =texi2html to view the texi2html script

The last useful zshism i will mention is the **/* notation which expands recursivly to all files and directorys that can be reached under the current dir. as in ls **/*.c will find every c file in the current dir and all its subdirectories and all the subdirectories and so forth. grep whereami **/* will search for whereami in all files from the current dir onward.

Color

I like color. especially when it conveys useful information or serves some purpose.

GNU ls can colorize your directory listings depending on what type of file is being displayed, its permissons or various other criteria. to enable this feature use the --color=tty option to ls. if you wish to always have it enabled, add this to your shells startup script alias ls="ls --color=tty" or alias ls="ls -F --color=tty" if you want a special character appended to the file to also let you know what type of file it is.

another place that color can be used effectivly is in your email. Are you using pine or elm or mh? i strongly suggest trying out mutt. mutt can do most anything and will colorize your mail deal with MIME properly and thread your mailbox which means it will groug messages and their replys together. see the mutt homepage for more.

many text editors will also be able to color code what you are editing. vim the editor i use (see my editor section) can color syntax hightlight just about anything you could concievably want to hightlight. just add :syntax on to your .vimrc (you need at least vim 5.0 for this)

Editor (vim)

an editor is a very personal choice. the editor i choose to use is vim. although the learning curve is a bit steep for vi-ish editors i strongly recommend you try out vim and take the time to learn it. it WILL pay off. some quickies. there are many neat things about vim.. I will definatly update this section when i have time.

Books

The undisputed king of practical unix knowledge in books is by far O'Reilly and Assosiates. basically, if you need a book on something and they have one on what you want you cannot go wrong. their books typically have an animal on the cover but recently they have been straying from the formula.

For hard therory Springer-Verlag is always a good bet. they also produce the "Yellow books" of mathematical fame, their CS books will often be grey but sometimes not if they are very theoretical and classifed more in the math section.

some other Excelent books i have and would very highly recommend if you are at all interested in the field are:

Philosophy

The tao of programing has all the guideance one could ask for.

back to my homepage.
back to my computer page.
email me: john@foo.net