Navigating the Filesystem


 This section looks at the file organization of Fedora 2 in general, based on the various utilities that are available and the location of configuration files. The root filesystem is indicated by the /. The contents of the root filesystem follow:   $ ls -F /   bin/   dev/  home/    lib/         misc/  opt/   root/  tftpboot/  usr/ boot/  etc/  initrd/  lost+found/  mnt/   proc/  sbin/  tmp/       var/ 

The utility programs are organized under the /bin , /usr/bin , and /usr/local/bin directories. The following tables list some of the common programs under these directories. It is very useful to ensure that these directories are set in the PATH environment variable.

Note

Remember, you can get full information on each of these by querying their man pages, and abridged details by typing the command followed by help .

Let s look at each of these directories in some detail.

The table that follows lists commands that are located in the /bin directory.

Command

Description

awk

Pattern-scanning and processing language

bash

The Bourne-again shell

cat

Concatenates files and prints on to standard output

chgrp

Changes the group ownership

chmod

Changes file access permissions

chown

Changes file ownership permissions

cp

Copies files and directories

cpio

Copies files to and from archives

csh

C-shell

cut

Removes sections from each line of input

date

Prints the current date and timestamp; super user may set the date and time

dd

Converts and copies files

Df

Displays disk usage for filesystems

dmesg

Displays startup messages

echo

Displays a line of text

ed

An old text editor

grep

Regular expression-matching program

gzip

GNU Zip program for compressing files

kill

Terminates running processes

Ln

Creates links to files and directories

Ls

Lists files

mail

Command line mail client

mkdir

Command line mail client

more

Paginates a file

mount

Maps a filesystem to a directory

mv

Moves a file from one location to another; same as renaming a file

netstat

Prints network statistics

ping

Checks for the network reachability of other machines on the network

ps

Lists currently running processes

pwd

Displays current working directory

rm

Removes files

rmdir

Removes directories

sed

Stream editor can be used to programmatically modify files and the output of programs

sh

Bourne shell

sleep

Delays for a specific amount of time

sort

Sorts the lines of input

su

Changes identity of a user

tar

Archiving program

tcsh

Enhanced C shell

touch

Updates the timestamp on a file

umount

Unmounts a currently mounted filesystem

uname

Prints system information

vi

A text editor

The commands in the following table are located in the /usr/bin directory.

Command

Description

At

Queues jobs for later execution

Bc

A bench calculator

Cc

C-compiler (this command is a symbolic link to the GNU C-compiler gcc)

Clear

Clears the screen

Crontab

Maintains a list of tasks to be performed later

Du

Reports disk usage for a directory and subdirectories

Emacs

An editor

F77

Fortran compiler

File

Prints file type

Find

File-searching utility

Finger

Looks up user information

ftp

File transfer program

Gcc

GNU C-compiler

Gdb

GNU debugger

Gftp

Graphical FTP client

Gimp

GNU image manipulation and painting program

Gmake

Maintains a group of programs (this command is a symbolic link to the GNU make command gmake )

Head

Displays the first few lines of a file

Ispell

Interactive spell checker

Lpr

Spools print jobs

Man

Displays manual pages for commands

Nslookup

Looks up a host s DNS information

Passwd

Changes a user s password

telnet

Telnet client allows remote logins

Wall

Sends a message to the terminals of all users currently logged on

Wc

Counts words, lines, and characters of input text

Which

Displays the full path of commands

Who

Displays the list of users currently logged on to the system

The next batch of files are system configuration files located in the /etc directory and its subdirectories. The following table contains some of the more commonly modified ones.

File

Description

Exports

Lists the filesystems to be exported via NFS

Ftpaccess

Configuration file for ftpd

Group

Lists the various groups on the system and each of their members

Hosts

Lists the hostname and IP addresses of machines

host.conf

Used by the DNS resolver library

Motd

Contains the message of the day

passwd

Contains user information for all users on the system

shadow

Contains the encrypted passwords of the user

xinetd.conf

Configuration file for the xinetd daemon

You can find administrative binaries under /sbin and /usr/sbin. The following table provides a list of commands from the /sbin directory.

Binary

Description

Arp

Prints a machine s Address Resolution Protocol (ARP) table

cardmgr

PCMCIA device manager

chkconfig

Manages runlevel information for system services

debugfs

Ext2 filesystem debugging utility

dhclient

DHCP client

e2fsck

Ext filesystem diagnosis and repair tool

fdisk

Disk-partitioning utility

fuser

Displays the IDs of processes using the specified files

ifconfig

Configures network interfaces

insmod

Installs loadable kernel modules

lspci

Lists all PCI devices on this systems

lspnp

Lists all PNP devices on this system

mkfs

Creates a new filesystem on a partition

modprobe

Detects and manages loadable modules

route

Displays and sets system routing table

sysctl

Displays or changes system parameters

The following table lists some of the files from the /usr/sbin directory.

Binary

Description

adduser

Creates a new user

automount

Configures mount points for autofs

chpasswd

Updates password file in batch mode

chroot

Runs command with the root set to a new root

gpm

Mouse-based cut and paste utility for virtual consoles

groupadd

Adds a new group

in.fingerd

Finger daemon

in.ftpd

FTP daemon

in.identd

identd daemon

in.telnetd

Telnet daemon

kudzu

Configures new hardware

pppd

PPP daemon

squid

HTTP caching server

tcpdump

TCP/IP diagnostics tool

vipw

Password file editor

zdump

Dumps time zone information

The /usr/local/bin directory usually houses new programs when they are installed.

Shared libraries (that is, libraries that contain common functions used by multiple programs at the same time without multiple in-memory copies) reside in the /lib , /usr/lib , and /usr/local/lib directories. It is often a good idea to ensure that the LD_LIBRARY_PATH environment variable contains these directories. This variable is not set by default, although it can be set in the .bashrc file or other startup files.

The /boot directory contains bootable images of Linux kernels . Following is an extract from a typical listing (here, the vmlinuz entries are the kernel binaries):

   $ ls /boot   boot.b chain.b config-2.4.18-14 config-2.4.18-17.8.0 ... vmlinuz-2.4.18-14 vmlinuz-2.4.18-17.8.0 

Transient and temporary files can be found under /var/tmp and /tmp . The /tmp directory is cleaned up by startup scripts after every reboot, whereas the /var/tmp directory is not. This behavior may dictate for some programmers the choice of using /var/tmp as opposed to /tmp .

Files related to peripherals, such as devices, can be found under the /dev directory. By convention, various peripherals, such as CD-ROM drives and floppy drives , are mounted under the /mnt directory. You ll see more on this directory in a later section.

The /proc directory provides a filesystem abstraction to the processes currently running on the system. Each process has a directory assigned to it and several files under it that contain information about the process. For more details, you should refer to the proc manual page by invoking the command man proc .

And, finally, as you first discovered in Chapter 2, the user s home directories are typically created under /home .




Beginning Fedora 2
Beginning Fedora 2
ISBN: 0764569961
EAN: 2147483647
Year: 2006
Pages: 170

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net