OK, if you studied paths in a previous topic, you know that there are executable files in places like /usr/bin and /bin. Did it ever occur to you that you might find executables in other places, places where users can create and install software?

The custom in Unix is that a user can indeed create programs, but because only the administrator can write in /usr/bin or other "secure places," users install their software in their own accounts. The custom is to put these in a subdirectory of the home account called "bin", short for "binary." My executable files are in a directory called

/homem/pauljohn/bin

I have one very special thing you might try. It is a special version of the "ls" command that shows color-coded output. Directory names have a different color than text files, and executable files in turn have a different color. If you want to give my ls a try, type the fill path to it at the Unix prompt:

prompt> /homem/pauljohn/bin/ls --color

The option "--color" tells my ls to show the color coded entries. I see dark blue directory names, white filenames, and bright green executable files.

If you decide you want to use my ls all the time (instead of the boring one color ls in the DEC unix), the best thing to do is to create an "alias" which automatically converts any "ls" you type into "/homem/pauljohn/bin/ls --color".

How you create the alias will depend on how your account is set up--meaning which "shell" you are using. ON a default lark account, the shell is Korn. And in Korn, the configuration is controlled in a file called ".kshrc". In my .kshrc file, I have an alias to tell the system to use my version of ls:

alias ls='ls --color'

This uses my ls because I have a PATH statement that puts /homea/pauljohn/bin at the beginning of my path. I don't recall how I set that PATH in Korn shell, but as I review my account, I sat it must be done either in ".profile" or ".login". I'm betting it is the latter! If you remind me, I'll check into it.

Now, in your account, you have to put the full path to my ls in there, so it would be:

alias ls='/homem/pauljohn/bin/ls --color=yes'

I like to have a shortcut to get a detailed file listing. So I also have this alias:

alias lsl='ls -la --color=yes'

Whenever I type "lsl" I get a long listing in color.

-- PaulJohnson - 07 Feb 05

 
|Powered by TWiki