The Software Stork
Interesting software comes from many places:Some other user on the same machine already has it for his or her own use, and you want to use it, too.
Network Some other machine on the network has a program you want for yourself. See Chapter 16 for the gory details of copying the program from other machines on the network.
Someone sends you programs through e-mail. (Yes, it’s possible, although you should be really, really sure that it’s from someone you trust before you install it.)
You create files that contain frequently used commands so that you don’t have to type them repeatedly. In UNIX-speak, these files are called shell scripts. In essence, you make your own multipurpose UNIX commands.
First, we talk about where you should put your own software. Then we go into more detail about the mechanics of putting it there.
You’ve bin had
Every UNIX user should have a bin directory. It’s just a directory named bin in your home directory. If it’s not there, you can make it by going to your home directory and typing this line:
mkdir bin
The thing that’s special about bin is that the shell looks for programs there. Most system administrators automatically set up a bin directory for users. If not, and you had to create it yourself, you may have to do some fiddling to tell the shell to look for programs there. See the sidebar "Your search path," later in this chapter, for the bad news.To put programs in your bin directory, you just copy them there by using the cp command. Alternatively, you can move them there by using the mv command, a text editor, or any other way to create or move a file.
Tip Why is it named bin?
Early on, bin was short for binary because most programs that people put there were, in fact, compiled binary code. In the late 1970s, a famous professor of cognitive science at the University of California published a paper titled "The Trouble with UNIX," in which he complained bitterly about how difficult it was to use UNIX. One of the items on his list was that bin was difficult to remember. One of the UNIX guys at Bell Labs published a witty rebuttal and pointed out that many of the allegedly "more natural" command names the professor suggested were merely the names the computer system at his university used. The UNIX guy reported that many Bell Labs users thought that a bin was the obvious place to stash their programs. So, it’s still a bin.The famous professor, who subsequently worked at Apple and Hewlett-Packard and is now back in academia, has come around somewhat and is reputed to even use UNIX now and then, although he probably shuts his office door so that no one can see.