Flylib.com

Books Software

 
 
 

Essential File System Commands from the bin and sbin Directories


Essential File System Commands from the /bin and /sbin Directories

The /bin (short for binary)directory holds your shell applications and many essential shell commands you need when running and booting Linux. The /sbin (or system binary)directory contains the various installed file systems, YaST, the SUSE Firewall, and other commands needed at boot or for the Root user to solve systemwide problems. On the average system, each directory will have 5-8MB worth of files in them, with /sbin a little bit bigger than /bin . Many, if not all, of these commands are statically linked, not dependent on other software libraries located in other directories (mostly /lib and /usr/lib ). Nearly every other application on your system relies on one or more of these external (or shared) libraries to run. These dynamically linked applications create a software ecosystem that ties an application to its operating system. Statically linked applications and commands, along with the kernel, represent the operating system itself.


Using the /boot and /dev Directories

The /boot directory contains a compressed version of the Linux kernel that loads at boot (earlier versions of the startup script delivered a message that the kernel was "exploding," which undoubtedly unnerved more than a few novices in those days). When you rebuild or install a new kernel, the new kernel and related files go first into this directory (see Chapter 24, "Kernel and Module Management," for more information on updating your kernel).

Linux device files are located in the /dev directory. As noted earlier, nearly everything in Linux is represented as a file. No further proof is needed than a peek into this directory. There you will find about 7,500 files representing devices that are or may some day be attached (or not) to your system. The more commonly used devices include the following:

  • IDE and SCSI hard drives , represented as hda and sda , respectively.

  • CD-ROM, CD-R, and CD-RW drives (and their DVD counterparts), some of which are IDE; others are viewed by the system as SCSI.

  • Serial ports, marked tty .

  • Pointing devices, such as /dev/input/mouse .

  • Universal Serial Bus (USB) devices, in the dev/usb directory.

  • Printers, marked lp .

If you're running short of disk space, you might think cleaning out some of these files would help you. Closer inspection reveals that they are all 0byte files. Leave them alone.


Editing Configuration Files in the /etc Directory

One of the beauties of Linux applications is the way you can make software your own. Whether it's changing the behavior of a command, adding a keyboard shortcut, or changing the color of the application title bar, there are lots of ways to make the applications you use work the way you want them to. Often, you don't even have to open the application you want to modify to make the changes you want. Most applications store their configurations in a simple text file located in the /etc directory. Scroll through the directory to see exactly what is there. Check to see which user owns a file before trying to edit it—if Root owns the configuration file, you'll have to log in as the SuperUser to make changes.

Some of the more important system- related configuration files in this directory are

  • fstab —This file system table lists each mountable storage device on your computer. These include hard drives, floppy drives, CD and DVD drives, and removable drives. The file displays each device's mount point, its location on the partition table, instructions on whether it should mount automatically on boot, and a few other options. See the section "Mounting a File System" in Chapter 18, "Managing Files, Volumes, and Drives ," for more information on /etc/fstab .

  • inittab —The system initialization table defines the different runlevels that the system uses at boot to start your computer. Changes to this file (which can be made manually, but also in YaST's suseconfig editor) can determine whether you boot to a graphical or text login screen, as well as whether someone can log in to the machine remotely with a dial-up modem. You will learn more about the boot process and runlevels in Chapter 22, "Managing the Boot Process and Other Services."

  • modprobe .conf and modprobe.conf.local —The main modprobe.conf file contains directions and options used when loading kernel modules to operate various pieces of hardware, such as sound cards, USB devices, network cards, and the like. The contents of this file are used during boot. SUSE engineers update this file from time to time and recommend that if you want to do your own editing, you use modprobe.conf.local to keep those changes from being overwritten. You will learn more about modprobe.conf in Chapter 24, "Kernel and Module Management."

  • passwd and shadow —The passwd file and its more secure counterpart , shadow , contain the list of all users on the system, along with their account information. It's often said in Unix circles that a user doesn't exist until she has a password. This is one of the reasons why. You will learn more about users and passwords in Chapter 19, "Managing Users, Managing Security."