6. Directories and Tab Completion
What do you think of Tips for Linux Explorers? I've received mostly positive emails on this new recurring section of the newsletter. But a few people have written to complain that a newsletter that bills itself as covering Windows and broadband is addressing Linux so regularly.

Well, I guess I can understand that concern. But Windows coverage is *not* dropping off the menu at Scot's Newsletter. I'll be covering Windows more and more as we ramp up toward the release of Windows Longhorn. But I'm interested in all viable operating systems, not just Windows. Linux is very intriguing, and I encourage SFNL readers to try it for themselves.

Tips for Linux Explorers is aimed at Windows users, in fact. It's designed to be a friendly outstretched hand for experienced Windows users who are interested in taking a Linux test drive to see what all the fuss is about. I'm not about to become some sort of Linux fanatic and forsake Windows entirely. But I always like to keep an open mind and explore new things. That's what Linux Explorers is about.

Even so, I want to hear what you think about it. Please send me any comments, suggestions, constructive criticisms about Tips for Linux Explorers that occur to you. I will share them with Bruno wherever it makes sense to. We would value your input.

Common Directories
The following is a simplified overview of the Linux Tree listing the most important subdirectories and brief descriptions where applicable:

/bin - Contains most user programs with normal user permissions
/boot - Where you can add extra kernels for multi booting
/dev - Contains all the special files (nodes) used to access hardware and other device drivers
/etc - Contains most of the config files
/home - Where the directories are those of the standard user
/home/{username} - Akin to Windows' My Documents folder
/home/{username}/tmp - Where a given user might download and store ISOs
/home/{username}/downloads - Other downloads, directory made by user
/home/{username}/documents - You guessed it, documents
/lib - All the libraries needed for installed programs to run
/lost and found - Where things end up after a "scandisk" due to an improper shutdown
/mnt - Where devices, such as disk drives, are mounted
/mnt/win_c (this subdirectory appears if you dual-boot Windows)
/mnt/cdrom
/mnt/floppy
/opt - Some 3rd-party programs, like Acrobat Reader, get installed here
/proc - A direct reflection of the system kept in memory)
/root - Where Konqueror opens as root
/root/drakx - Only if you run Mandrake
/root/tmp
/sbin - Most executables that need root permission)
/tmp - System temp files
/usr - Contains no files, only directories (most important ones follow)
/usr/bin - Most executables for programs with user permission
/usr/local/bin - Programs you install yourself
/usr/src - For extra kernel sources and downloaded RPMs
/var - Contains no files, only directories (most important one follows)
/var/log - all the log files, and there are many

For far more information, type the following and press Enter:

$ man hier

Tab Completion Tip
Did you know you can use the Tab key to auto-complete commands on the command line? Just type a few characters that start a command and press the Tab key. The command or name of an existing directory or file will be completed.

Try this. Type the following and then press the Tab key:

$ cd /u

Now add an "s" and press Tab, type "h" and press Tab. The result should be:

$ cd /usr/share/

Now type "f" "o" "n" and press Tab, "t" press Tab, "d" Tab, and press the Enter key. That should put you in:

/usr/share/fonts/ttf/decoratives

Type the following and press Enter:

ls

That'll bring up a list of all the fancy ttf fonts on your system.

So next time you have to type a long command like this:

# cp synthesis.hdlist.update_source.cz /var/lib/urpmi/synthesis.hdlist.update_source.cz

... try it this way instead:

# cp sy (Tab key), /v (Tab key), li (Tab key), u (Tab key), sy (Tab key)

And because the full command is on your screen, the light will go on if it hasn't already! (Note: This command works only if the file "synthesis.hdlist.update_source.cz" is in your /home directory)

How about a little more on the Tab key and commands. If you don't remember exactly how a command was written, type in the first character or two and hit the Tab key. You'll get a list of all the commands that start with the same character(s).

If you wish to know what a certain command does -- say, mkmanifest -- use the whatis command, like this:

$ whatis mkmanifest

mkmanifest (1) - Makes list of file names and their DOS 8+3 equivalents.

O'Reilly Network offers a useful list of all Linux commands with descriptions.