Hard Disk Drive Resource Links (Linux System)

http://www.nyx.net/~sgjoen/disk.html
This document describes how best to use multiple discs and partitions for a Linux system. Although some of this text is Linux specific, the general approach outlined here can be applied to many other multi tasking operating systems.

http://tldp.org/HOWTO/Hard-Disk-Upgrade/index.html
This document describes how to copy a Linux system from one hard disc to another.

http://tldp.org/HOWTO/Partition-Rescue/index.html
This document describes how to rescue your Linux partition if MS-DOS deleted it.

http://tldp.org/HOWTO/Partition/index.html
This document explains how to plan and layout disc space for a Linux system. It talks about disk hardware, partitions, swap space sizing and positioning considerations, file systems, file system types, and related topics. The intent is to teach some background knowledge, not procedures.

http://tldp.org/HOWTO/Large-Disk-HOWTO.html
This document covers how to configure disc drives with more than 1024 cylinders for use with Linux.

http://tldp.org/HOWTO/Root-RAID-HOWTO.html
This document provides a cookbook for creating a root mounted RAID file system and companion fallback rescue system using Linux initrd. There are complete step-by-step instruction for both raid1 and raid5 md0 devices. Each step is accompanied by an explanation of its purpose. Included with this revision is a generic Linux initrd file which may be configured with a single three line /etc/raidboot.conf file for raid1 and raid5 configurations.

Read More

Linux Document Preparation

addftinfo        Add information to troff font files for use with groff.
afmtodit        Create font files for use with groff.
colcrt        Filter nroff output for CRT previewing.
enscript        Convert text files to postscript.
eqn        Format equations for troff. Compiles descriptions of equations embedded in troff.
geqn        Used to print special symbols and complex equations. Not user friendly.
git        GNU interactive tools.
gitaction        Per file type action script.
gitkeys        Display key sequence utility.
gitmount        Allows any block device to be mounted.
gitps        A graphical process viewer and killer program.
gitrgrep        A recursive grep program.
gitunpack        Used to unpack archive files in a given directory.
gitview        A hexadecimal or ASC file viewer.
grodvi        Convert Groff output to TeX dvi format, normally run by groff.
groff        Used as a front end for the groff document formatting system.
grops        Postscript driver for groff. invoked by groff.
gtbl        Used to prepare charts, multicolumn lists and tabular formats.
hpftodit        Create font description files for use with groff.
indxbib        Make inverted index for bibliographic databases.
lookbib        Search bibliographic databases.
nroff        Emulate nroff command with groff.
pfbtops        Translate a postscript font in .pbf format to ASCII.
pic        Compile pictures for troff or Tex.
psbb        Extract bounding box from postscript document.
refer         Preprocess bibliographic references for groff.
rpm2html        Make an html database from rpm repository.
soelim        Interpret .so requests in groff input.
tbl        Format tables for groff.
TeX        Used to format professionally typeset documents (Chapters, Headings, and paragraphs).
texi2html        Texinfo to html converter.
tfmtodit        Create font files for use with groff.
troff        Formats documents as part of the groff document formatting system.
yacc        A parser generator.

Read More

Linux Printing and Programming

Linux Printing

banner        Print a large banner on printer.
lpr        Print, submits a job to the printer.
Ex: lpr -Pdest filename. Dest is the destination printer. the name of the file to print is filename.
lpc        Lets you check the status of the printer and set its state.
lpq        Shows the contents of a spool directory for a given printer.
lprm         Removes a job from the printer queue.
gs        Ghostscript – A PostScript interpreter.
pr        Print a file. Ex: pr filename |pg.
tunelp        Set various parameters for the lp device.

Linux Programming

as86        Assembler
awk        C programming language – allows finding of lines with specific characters.
bc        A precision calculator language.
cproto        Reads in c source files and generates function prototypes for all the functions.
ctags        Generate tag (index) files for source code.
dialog        Display dialog boxes from shell scripts.
egcs        GNU project C and C++ compiler.
f2c        Converts fortran code to c code.
gawk        Pattern scanning and processing language. GNU’s implementation of awk.
gcc        GNU c and c++ compiler.
-g        Produce debugging information.
-pg        Generate profile info that will allow the gprof program to display timing info.
gdb        Debugging program.
gprof        In /usr/bin, allows you to tell where most of the execution time is spent in a program.
igawk        Gawk with include files.
indent        Reformats c source code for consistent indenting and opening and closing brackets consistent.
ld         The GNU linker.
ld86        Linker for as86.
make        GNU make utility to maintain a group of programs.
nm        Lists symbols from object files.
objcopy        Copy and translate object files.
objdump        Display information from object files.
p2c        Converts pascal code to c code.
prompt        set prompt = “waldo” (in C shell) ps1 = ‘waldo’ (in BOURNE shell)
PS1=”[\u@\h \w]\\$ ” makes prompt = [username@hostname current directory]
see the BASH or your shell’s man page for more information.
size        List section sizes and total size.
strip        Discard symbols from object files.
xxgdb        X windows based graphical user interface to gdb.

Scripting Languages

Perl        A command interpreter for the Practical Extraction and Report Language (perl).
Python        A report language.
Tcl        Tool command language shell. Enter by typing tclsh.
info        Return information about the state of the Tcl interpreter.
Tk        A graphical user extension to Tcl based on X windows. Commands are same as Tcl.

Read More

Linux User Management

ac        Print statistics about users’ connect time.
accton        Turn on accounting of processes. To turn it on type “accton /var/log/pacct”.
adduser        Ex: adduser mark – Effect: Adds a user to the system named mark
chage        Used to change the time the user’s password will expire.
chfn        Change the user full name field finger information
chgrp        Changes the group ownership of files.
chown        Change the owner of file(s ) to another user.
chpasswd        Update password file in batch.
chroot        Run command or interactive shell with special root directory.
chsh        Change the login shell.
edquota        Used to edit user or group quotas. This program uses the vi editor to edit the quota.user and quota.group files. If the environment variable EDITOR is set to emacs, the emacs editor will be used. Type “export EDITOR=emacs” to set that variable.
faillog        Examine faillog and set login failure limits.
finger        See what users are running on a system.
gpasswd        Administer the /etc/group file.
groupadd        Create a new group.
grpck        Verify the integrity of group files.
grpconv        Creates /etc/gshadow from the file /etc/group which converts to shadow passwords.
grpunconv        Uses the files /etc/passwd and /etc/shadow to create /etc/passwd, then deletes /etc/shadow which converts from shadow passwords.
groupdel        Delete a group.
groupmod        Modify a group.
groups        Print the groups a user is in
id        Print real and effective user id and group ids.
last        Display the last users logged on and how long.
lastb        Shows failed login attempts. This command requires the file /var/log/btmp to exist in order to work. Type “touch /var/log/btmp” to begin logging to this file.
lastcomm        Display information about previous commands in reverse order. Works only if process accounting is on.
lastlog        Formats and prints the contents of the last login.
logname        Print user’s login name.
newgrp        Lets a suer log in to a new group.
newusers        Update and create newusers in batch.
passwd        Set a user’s pass word.
pwck        Verify integrity of password files.
pwconv        Convert to and from shadow passwords and groups.
quota        Display users’ limits and current disk usage.
quotaoff        Turns system quotas off.
quotaon        Turns system quotas on.
quotacheck        Used to check a filesystem for usage, and update the quota.user file.
repquota        Lists a summary of quota information on filesystems.
sa        Generates a summary of information about users’ processes that are stored in the /var/log/pacct file.
smbclient        Works similar to an ftp client enabling the user to transfer files to and from a windows based computer.
smbmount        Allows a shared directory on a windows machine to be mounted on the Linux machine.
smbpasswd        Program to change users passwords for samba.
su        Ex: su mark – Effect: changes the user to mark, If not root will need marks password.
sulogin        Single user login.
ulimit        A bash builtin command for setting the processes a user can run.
useradd        Create a new user or update default new user information.
userdel        Delete a user account and related files.
usermod        Modify a user account.
users        Print the user names of users currently logged in.
utmpdump        Used for debugging.
vigr        Edit the password or group files.
vipw        Edit the password or group files.
w        Display users logged in and what they are doing.
wall        Send a message to everybody’s terminal.
who        Display the users logged in.
whoami        Print effective user id.

Read More

Linux System Management

Environment

Linux System Management env        Show all environment variables.
export        Set the value of a variable so it is visible to all subprocesses that belong to the current shell.
printenv        Print all or part of environment.
reset        Restores runtime parameters for session to default values.
set        Shows how the environment is set up. This is a builtin bash command.

Library management

ldconfig        Updates the necessary links for the run time link bindings.
ldd        Tells what libraries a given program needs to run.
ltrace        A library call tracer.
trace        Same as ltrace.

Module and kernel management

depmod        Handle loadable modules automatically. Creates a makefile-like dependency file.
dmesg        Print or control the kernel ring buffer. This shows the last kernel startup messages.
genksyms        Generate symbol version information.
insmod        Install loadable kernel module.
lsmod        List currently installed kernel modules.
modprobe        Used to load a set of modules that are marked with a specified tag.
rmmod        Unload loadable modules.

Runtime level management

exit        Terminates the shell.
halt        Stop the system.
init        Process control initialization.
initscript        Script that executes inittab commands.
logout        Log the user off the system.
poweroff        Brings the system down.
reboot        Reboot the system.
runlevel        List the current and previous runlevel.
setsid        Run a program in a new session.
shutdown        If your system has many users, use the command “shutdown -h +time message”, where time is the time in minutes until the system is halted, and message is a short explanation of why the system is shutting down.
# shutdown -h +10 ‘We will install a new disk. System should be back on-line in three hours.’
telinit        By requesting run level 1 a system can be taken to single user mode.

System Configuration tools

ctrlaltdel        Set the function of the ctrl alt del combination.
isapnp        Configure ISA plug and play devices.
kbdconf         A Redhat Linux tool which configures the /etc/sysconfig/keyboard file which specifies the location of the keyboard map file. This is a GUI based tool.
kbdrate        Set the keyboard repeat rate and delay time.
kernelcfg        A Redhat GUI kernel configuration tool, Start X, then run it from a console session.
linuxconf        Redhat’s GUI linux system configuration tool.
lspci        List all pci devices.
mesg        Control write access to your terminal.
mouseconfig        A Redhat Linux tool used to configure the /etc/sysconfig.mouse file. This is a GUI tool.
ndc        Script file used to restart, stop, start the DNS server.
Printtool        Redhat’s GUI printer configuration tool.
quota        Display disk usage and limits.
quotacheck        Scan a filesystem for disk usages.
quotaoff        Turn file system quotas off.
quotaon        Turn file system quotas on.
samba        Script file used to stop, start, restart samba services when not run using inetd.
setpci        Configure pci devices.
setserial        Set/get serial port information.
setterm        Set terminal attributes.
setup        Set up devices and file systems.
stty        Used to configure and print the console devices.
swapon        Enable devices and files for paging and swapping.
swapoff        Disable devices and files for paging and swapping.
timeconfig        A Redhat Linux tool used to configure the /etc/sysconfig/clock file. This is a GUI tool used to set timezone and whether or not the clock is set to GMT time.
tset        Used to initialize terminals.

System Information

arch        Print machine architecture.
df         Shows disk free space.
du        Shows disk usage.
free        Display used and free memory on the system.
ipcrm        Provide information on ipc facilities.
ipcs        Same as ipcrm.
lsdev        Display information about installed hardware via files in the /proc directory.
lsof        List open files.
lspci        List PCI devices .
pnpdump        Lists ISA plug and play devices resource information.
procinfo        Display system status gathered from proc.
pstree        Display a tree of processes.
runlevel        Find the current and previous system runlevel.
strace        Trace ssytem calls and signals for a binary program.
stty        Change and print terminal line settings.
tload        Prints a graphic representation of the system load average.
tty        Print the filename of the terminal connected to standard input.
uname        Print system information, Prints Linux.
vmstat        Report virtual memory statistics.
xcpustate        Displays CPU states (idle, nice, system, kernel) statistics. Runs in X?

System Logging

klogd        Kernel log daemon which intercepts and logs Linux kernel messages.
logger        Make entries in the system log.
syslogd        Linux system logging utilities.
sysklogd        Linux system logging utilities.

System Security

System time
cal        Calendar.
clock        Used to change or get current time. The command “clock -–w” sets the hardware clock.
date        Print or set the system date and time.
hwclock        Set or read the hardware CMOS clock.
timed        Time server daemon to synchronize the host’s time with other machines, normally invoked at boot time from the rc(8) file.
timedc        Timed control program.
tzset        Used to change the users private time zone by setting the TZ environment variable.
uptime        Reports how long the system has been running.
zdump        Prints the current time in each zonename named on the command line.
zic        Reads text from files named on the command line and creates time conversion files.

X Management and programs

SuperProbe        Probe video hardware.
Xconfigurator        The Redhat tool used during system setup to configure X.
xconsole        Displays messages usually sent to /dev/console.
xf86config        Older version of XF86Setup.
XF86Setup        A newer X configuration program with a GUI interface which modifies the “/etc/X11/XF86Config” configuration file.
xvidtune        This program will test video modes on the fly without modification to your X configuration. Read the usr/X11R6/lib/X11/doc/VideoModes.doc file before running this program.

Read More

Miscellaneous Linux Commands

Keys and keycodes and console

Linux Commands dumpkeys        Dump keyboard translation tables.
getkeycodes        Print kernel scancode-to-keycode mapping table.
lesskey        Specify key bindings for less.
loadkeys        Load keyboard translation tables.
psfaddtable        Add a unicode character table to a console font.
psfgettable        Extract the embedded Unicode character table from a console font.
psfstriptable        Remove the embedded Unicode character table from a console font.
resizecons        Change kernel idea of the console size.
setkeycodes        Load kernel scancode-to-keycode mapping table.

Ncurses functions

captoinfo        Convert a termcap description into a terminfo description.
clear        Clear the terminal screen.
infocmp        Compare or print out terminfo descriptions.
reset        Restore run-time parameters for session to default values.
tie        Merge or apply WEB change files.
toe        Table of terminfo entries.
tput        Initialize a terminal or query terminfo database.
tset        Terminal initialization.

CD programs

cdparanoia        An audio CD reading utility.
cdrecord        Record audio or data compact Disks from a master.

Other

alias        Ex:: alias dir=’ls -a’ – Effect: Makes dir list all files (no spaces next to the = sign).
bison        GNU project parser generator.
chvt        Change foreground virtual terminal.
crack        Program used to find bad passwords or crack security.
cvs        Concurrent Versions System.
deallocvt        Gets rid of unused virtual terminals.
dumpkeys        Dump keyboard translation tables.
fc         Fix command. Used to edit the commands in the current history list.
gdbm        The GNU database manager.
gpm        A cut and paste mouse server.
history        Show commands listed in the shell history (last n).
lilo        Boot management program.
mc        Visual shell for Unix like system. A file manager.
nc        A file manager.
pdksh        Public domain Korn shell.
pilot        Filesystem browser.
PS1=”Please enter a command”        Set Bash level 1 response.
PS2=”I need more information”        Set Bash level 2 response.
rcs        Recision Control system. Change RCS file attributes.
sash        Standalone shell with built in commands.
screen        Screen manager with VT100 terminal emulation.
sleep        Ex: “sleep 2” – wait 2 seconds.
tcsh        C shell with filename completion and command line editing.
unalias        Ex: “unalias dir” – Effect: Removes the alias dir.
units        Unit conversion program.
variables

* set – Ex: set t=/temp
* unset – Ex: unset t
* echo – Ex: echo $t

zsh        The Z shell.
ttysnoop        A program that comes with some systems that lets the administrator to snoop on the user’s terminals.

Read More

Linux File Management and Viewing

File and Directory management

apropos
Search the whatis database for files containing specific strings.

bdflush
Kernel daemon that saves dirty buffers in memory to the disk.

cd
Change the current directory. With no arguments “cd” changes to the users home directory.

chmod
chmod <specification> <filename> – Effect: Change the file permissions.
Ex: chmod 751 myfile        Effect: change the file permission to rwx for owner, re for group
Ex: chmod go=+r myfile        Effect: Add read permission for the owner and the group
character meanings u-user, g-group, o-other, + add permission, – remove, r-read, w-write,x-exe
Ex: chmod a +rwx myfile        Effect: Allow all users to read, write or execute myfile
Ex: chmod go -r myfile        Effect: Remove read permission from the group and others
chmod +s myfile – Setuid bit on the file which allows the program to run with user or group privileges of the file.
chmod {a,u,g,o}{+,-}{r,w,x} (filenames) – The syntax of the chmod command.

chown
chown <owner1> <filename> Effect: Change ownership of a file to owner1.

chgrp
chgrp <group1> <filename> Effect: Change group.

cksum
Perform a checksum and count bytes in a file.

cp
cp <source> <destination> Copy a file from one location to another.

dd
Convert and copy a file formatting according to the options. Disk or data duplication.

dir
List directory contents.

dircolors
Set colors up for ls.

file
Determines file type. Also can tell type of library (a.out or ELF).

find
Ex: find $Home –name readme Print search for readme starting at home and output full path.

How to find files quickly using the find command:
Ex: find ~ -name report3 –print

* “~” = Search starting at the home directory and proceed through all its subdirectories
* “-name report3” = Search for a file named report3
* “-print” = Output the full path to that file

install
Copy multiple files and set attributes.

ln
Make links between files.

locate
File locating program that uses the slocate database.

losetup
Loopback device setup.

ls
List files. Option -a, lists all, see man page “man ls”
Ex: “ls Docum Projects/Linux” – The contents of the directories Docum and Projects/Linux are listed.
To list the contents of every subdirectory using the ls command:

1. Change to your home directory.
2. Type: ls -R

mkdir
Make a directory.

mknod
Make a block or character special file.

mktemp
Make temporary filename.

mv
Move or rename a file. Syntax: mv <source> <destination> Ex: mv filename directoryname/newfilename

pathchk
Check whether filenames are valid or portable.

pwd
Print or list the working directory with full path (present working directory).

rm
Ex: “rm .*” – Effect: Delete system files (Remove files) –i is interactive option.

rmdir
rmdir <directory> – Remove a directory. The directory must be empty.

slocate
Provides a secure way to index files and search for them. It builds a database of files on the system.

stat(1u)
Used to print out inode information on a file.

sum
Checksum and count the blocks in a file.

test
Check file types and compare values.

touch
Change file timestamps to the current time. Make the file if it doesn’t exist.

update
Kernel daemon to flush dirty buffers back to disk.

vdir
List directory contents.

whatis
Search the whatis database for complete words.

wheris
Locate the binary, source and man page files for a command.

which
Show full path of commands where given commands reside.

File viewing and editing

ed
Editor

emacs
Full screen editor.

gitview
A hexadecimal or ASC file viewer.

head
head linuxdoc.txt – Look at the first 10 lines of linuxdoc.txt.

jed
Editor

joe
Editor

less
q-mandatory to exit, Used to view files.

more
b-back q-quit h-help, Used to view files.

pico
Simple text editor.

tail
tail linuxdoc.txt – Look at the last 10 lines of linuxdoc.txt.

vi
Editor with a command mode and text mode. Starts in command mode.

File compression, backing up and restoring

ar
Create modify and extract from archives.

bunzip2
Newer file decompression program.

bzcat
Decompress files to stdout.

bzip2
Newer file compression program.

bzip2recover
Recovers data from damaged bzip2 files.

compress
Compress data.

cpio
Can store files on tapes. to/from archives.

dump
Reads the filesystem directly.

gunzip
unzip <file> – unzip a gz file.

gzexe
Compress executable files in place.

gzip
gzip <file> – zip a file to a gz file.

mt
Control magnetic tape drive operation.

tar
Can store files on tapes.
Usage: tar cvf <destination> <files/directories> – Archive copy groups of files
Ex: tar /dev/fdo temp Effect: Copy temp to drive A:

uncompress
Expand data.

unzip
unzip <file> – unzip a zip file. Files ending in “.gz” or “.zip” are compressed.

zcat
Used to restore compressed files.

zcmp
Compare compressed files.

zdiff
Compare compressed files.

zforce
Force a .gz extension on all gzip files.

zgrep
Search possibly compressed files for a regular expression.

zmore
File filter for crt viewing of compressed text.

znew
Recompress .z files to .gz files.

zip
zip <file> – make a zip file.

Extra control and piping for files and other outputs

basename
Strip directory and suffix information from filenames.

cat
Ex: cat < filename — Effect: put keyboard input into the file. CTRL-D to exit (end).

cmp
Compare two files.

colrm
Remove columns from a file.

column
Columnate lists.

comm
Ex: comm file1 file2 — Effect compare the contents of file1 and file2 produces 3 columns of output. Lines in the first file, lines in second file, lines in both files.

csplit
Split a file into sections determined by context lines.

cut
Remove sections from each line of files.

diff
Show the differences between files. Ex: diff file1 file2

diff3
Find differences between 3 files.

dirname
Strip the non-directory suffix from a filename.

echo
Display a line of text.

egrep
Similar to grep -E, compatible with UNIX egrep.

expand
Convert tabs to spaces.

expr
Evaluate expressions.

false
Do nothing. Exit with a status indicating failure.

fgrep
Same as grep -F.

fold
Wrap each input line to fit in specified width.

join
Join lines of two files in a common field.

grep
grep pattern filename.
Ex: grep ” R ” — Effect: Search for R with a space on each side
Ex: ls –a |grep R — Effect: List all files with an R in them or their info listing.

hexdump
asc, decimal, hex, octal dump.

logname
Print user’s login name.

look
Display lines beginning with a given string.

mkfifo
Create named pipes with the given names.

nl
Write each file to standard output with line numbers added.

od
Dump files in octal and other formats.

patch
Apply a diff file to an original.

paste
Combines from 2 or more files. Ex: paste file1 file 2

printf
Print and format data.

rev
Reverses lines in a file.

script
Make a typescript of a terminal session.

sdiff
Find differences between 2 files and merge interactively.

sed
A stream editor. Used to perform transformations on an input stream.

sleep
Delay for a specified amount ot time.

sort
Sort a file alphabetically.

split
Split a file into pieces.

strings
Print the strings of printable characters in files.

tac
Concatenate and print files in reverse.

tee
Read from standard input and write to standard output and files.

tr
Translate or delete characters.

true
Do nothing. Exit with a status indicating success.

tsort
Perform topological sort.

ul
Do underlining.

unexpand
Convert tabs to spaces.

uniq
Remove duplicate lines from a sorted file.

uudecode
Used to transform files encoded by uuencode into their original form.

uuencode
Encode a binary file to be sent over a medium that doesn’t support non-ASC data.

wc
Count lines, words, characters in a file. Ex: wc filename.

xargs
Build and execute command lines from standard input.

yes
Output the string “y” until killed.

Read More

Linux Filesystem Management

badblocks
Used to search a disk or partition for badblocks.

cfdisk
Similar to fdisk but with a nicer interface.

debugfs
Allows direct access to filesystems data structure.

df
Shows the disk free space on one or more filesystems.

dosfsck
Check and repair MS-Dos filesystems.

du
Shows how much disk space a directory and all its files contain.

dump
Used to back up an ext2 filesystem. Complement is restore.

dumpe2fs
Dump filesystem superblock and blocks group information. Ex: dumpe2fs /dev/hda2

e2fsck
Check a Linux second extended filesystem.

e2label
Change the label on an ext2 filesystem.

exportfs
Used to set up filesystems to export for nfs (network file sharing).

fdisk
Used to fix or create partitions on a hard drive.

fdformat
Formats a floppy disk.

fsck
Used to add new blocks to a filesystem. Must not be run on a mounted file system.

hdparm
Get/set hard disk geometry parameters, cylinders, heads, sectors.

mkfs
Initializes a Linux filesystem. This is a front end that runs a separate program depending on the filesystem’s type.

mke2fs
Create a Linux second extended filesystem.

mkswap
Sets up a Linux swap area on a device or file.

mount
Used to mount a filesystem. Complement is umount.

rdev
Query/set image root device, swap device, RAM disk size of video mode. What this does is code the device containing the root filesystem into the kernel image specified.

rdump
Same as dump.

rmt
Remote magtape protocol module.

restore

Used to restore an ext2 filesystem.

setfdprm
Set floppy drive parameters.

swapoff(8)
Used to de-activate a swap partition.

swapon(8)
Used to activate a swap partition.

sync

Forces all unwritten blocks in the buffer cache to be written to disk.

tune2fs
Adjust tunable filesystem parameters on second extended filesystems.

umount
Unmounts a filesystem. Complement is mount.

Read More

Linux File Formats

linux File formats/etc/crontab
The syntax of each line in this file is:

minute, hour, day of month, Month, day of week, (user name), command

/etc/fstab
Columns are: device file to mount, directory to mount on, filesystem type, options, backup frequency, and fsck pass number (To specify the order in which filesystems should be checked on boot; 0 means no check.) The noauto option stops this mount from being done automatically on boot. Below is a detailed list of what is on each column.

1. The name of the device such as “/dev/hda1”
2. The mount point. Use “/” for root. Other typical mount points are “/dos” for DOS, “swap” or “none” for the swap partition, and “/mnt/floppy” for “/dev/fd0” (the floppy drive).
3. The type of filesystem. They are: mini, ext, ext2(linux native), xiafs, msdos, hpfs, ntfs, fat32, iso9660(CD-ROM), NFS, swap (for swap space).
4. The mount options for use with the filesystem. Each filesystem type has different mount options. Read the mount man page to see possible options. ro= read only, user- allows normal users to mount the device.
5. The frequency the filesystem needs to be dumped (backed up) by the dump command. For ext2, normally make it 1, for others make it 0. 0 or nothing means it is not dumped. If 1, it is backed up during a system backup.
6. A number telling the order in which the filesystems should be checked at reboot time by the fsck program. Your root should be 1, others are in ascending order or 0 to not be checked.

/etc/hosts
Sets up host address information for local use. The format is:

IPaddress name1 name2…

/etc/inetd.conf
Sets the services under the inetd daemon. The fields of this file are:

1. service name
2. socket type
3. protocol
4. wait or nowait
5. user
6. server program name
7. server program command line arguments

/etc/inittab
Sets the init configuration. An entry in the inittab file has the following format:

id:runlevels:action:process

/etc/lilo.conf
Tells LILO how to boot
The lilo.conf file below is for a system which has a Linux root partition on /dev/hda1 and a MS-DOS partition on /dev/hda2. See the “How Linux Works” guide and the “Linux User’s Guidel” for more information.

boot = /dev/hda        # Tell LILO to install the boot loader on the /dev/hda disk boot record
vga = normal        # Set a normal video mode
delay = 60        # The time in tenths of seconds to press <SHIFT> to get the LILO prompt
# Equivalent would be “prompt” on one line, and “timeout=60” on
# another line.
default=msdos        # Sets the default boot to DOS, Without this line, the default is the first stanza
install = /boot/boot.b        # The file containing the boot sector to use
compact        # Have LILO perform some optimization.
map = /boot/map        #Specifies the map file LILO creates when installed
# Section for Linux root partition on /dev/hda2.
image = /vmlinuz        # Location of kernel
label = linux         # Name of the OS that is displayed in the LILO boot menu
root = /dev/hda1         # Location of root partition, if this isn’t here the kernel image must have
# this set using the rdev command
read-only         # Mount read only on startup, Can also be set by rdev
# Section for MSDOS partition on /dev/hda1.
other = /dev/hda2         # Location of partition
table = /dev/hda         # Location of partition table for /dev/hda2
label = msdos         # Name of OS (for boot menu)

if the command “vga= ask” is given, LILO will prompt the user for a video mode at boot time.

/etc/passwd
The file has one line per username, and is divided into seven colon-delimited fields:

1. Username.
2. Password, in an encrypted form.
3. Numeric user id.
4. Numeric group id.
5. Full name or other description of account. This is called gecos.
6. The user’s home directory.
7. The user’s login shell (program to run at login).

The format is explained in more detail on the passwd manual page.

/usr/X11R6/lib/X11/XF86Config
The main XFree86 configuration file. Type “man XF86Config”

* The first section is “Files”
RgbPath        Sets the path to the X11R6 RGB color database
FontPath        Sets the path to a directory containing X11 fonts
* The second section is “ServerFlags”, all lines are commented out
* The third section is “Keyboard”
* The fourth section is “Pointer”
Protocol        Specifies the mouse protocol
Device        Specifies the device file by which the mouse can be accessed.

* The fifth section is “Monitor” which specifies the characteristics of your monitor
ModeLine        Specifies resolution modes for your monitor

The file, VideoModes.doc describes in detail how to determine the ModeLine values for each resolution mode. Two files, modeDB.txt and Monitors,may have ModeLine information for your monitor. They are located in /usr/X11R6/lib/X11/doc.

* The sixth section is “Screen” describing the video/monitor card configuration for the particular server.
The Driver line specifies the X server that you will be using. Valid Driver values are:

_ Accel: For the XF86 S3, XF86 Mach32, XF86 Mach8, XF86 8514,

XF86 P9000, XF86 AGX,and XF86 W32 servers;
_ SVGA: For the XF86 SVGA server;
_ VGA16: For the XF86 VGA16 server;
_ VGA2: For the XF86 Mono server;
_ Mono: For the non-VGA monochrome drivers in the XF86 Mono and XF86 VGA16 servers.
Be sure that /usr/X11R6/bin/X is a symbolic link to this server.

The Device line specifies the Identifier of the Device section that corresponds to the video card to use for this server. Above, we created a Device section with the line Identifier “#9 GXE 64”

Therefore, we use “#9 GXE 64” on the Device line here. Similarly, the Monitor line specifies the name of the Monitor section to be used with this server. Here, “CTX 5468 NI” is the Identifier used in the Monitor section described above.

*Subsection “Display” defines several properties of the XFree86 server corre-sponding to your monitor/video card combination. The XF86Config file describes all of these options in detail. Most of them are not necessary to get the system working.

The options that you should know about are:

o_ Depth. Defines the number of color planes; that is, the number of bits per pixel. Usually, Depth is set to 16. For the VGA16 server, you would use a depth of 4, and for the monochrome server a depth of 1. If you use an accelerated video card with enough memory to support more bits per pixel, you can set Depth to 24, or 32.

o _ Modes. This is the list of mode names that have been defined using the ModeLine directive(s) in the Monitor section. In the above section, we used ModeLines named “1024×768”, “800×600”,and “640×48″0. Therefore, we use a Modes line of

Modes “1024×768” “800×600” “640×480”

The first mode listed on this line is the default when XFree86 starts. After XFree86 is running, you can switch between the modes listed here using the keys Ctrl – Alt –Numeric + and Ctrl – Alt – Numeric – .
It might be best, when you initially configure XFree86, to use lower resolution video modes like 640×480, which tend to work with most systems. Once you have the basic configuration working, you can modify XF86Config to support higher resolutions.

o_ Virtual. Set the virtual desktop size. XFree86 can use additional memory on your video card to extend the size of the desktop. When you move the mouse pointer to the edge of the display, the desktop scrolls, bringing the additional space into view. Even if you run the server at a lower video resolution like 800×600, you can set Virtual to the total resolution that your video card can support. A 1-megabyte video card can support 1024×768 at a depth of 8 bits per pixel; a 2-megabyte card 1280×1024 at depth 8, or 1024×768 at depth 16. Of course, the entire area will not be visible at once, but it can still be used. The Virtual feature is rather limited. If you want to use a true virtual desktop, fvwm and similar window managers allow you to have large, virtual desktops by hiding windows and using other techniques, instead of storing the entire desktop in video memory. See the manual pages for fvwm for more details about this. Some Linux systems use fvwm by default.

o_ ViewPort. If you are using the Virtual option that is described above, ViewPort sets the coordinates of the upper-left-hand corner of the virtual desktop when XFree86 starts up. Virtual 0 is often used. If this is unspecified, then the desktop is centered on the virtual desktop display, which may be undesirable to you.

Read More

Linux Configuration Files

linux Configuration filesprofile
System wide environment and startup script program.

/dev/MAKEDEV
The /dev/MAKEDEV file is a script written by the system administrator that creates local only device files or links such as device files for a non-standard device driver.

/etc/aliases
Where the user’s name is matched to a nickname for e-mail.

/etc/bootptab
The configuration for the BOOTP server daemon.

/etc/crontab
Lists commands and times to run them for the cron deamon.

/etc/dhcpd.conf
The configuration file for the DHCP server daemon.

/etc/ethers
File for RARP mapping from hardware addresses to IP addresses. See the man page ethers(5).

/etc/exports
The file describing exported filesystems for NFS services.

/etc/fdprm
The floppy disk parameter table. Describes the formats of different floppy disks. Used by setfdprm.

/etc/filesystems
Can be used to set the filesystem probe order when filesystems are mounted with the auto option. The nodev parameter is specified for filesystems that are not really locally mounted systems such as proc, devpts, and nfs systems.

/etc/fstab
Lists the filesystems mounted automatically at startup by the mount -a command (in /etc/rc or equivalent startup file).

/etc/group
Similar to /etc/passwd but for groups rather than users.

/etc/groups
May contain passwords that let a user join a group.

/etc/gshadow
Used to hold the group password and group administrator password information for shadow passwords.

/etc/host.conf
Specifies how host names are resolved.

/etc/hosts
List hosts for name lookup use that are locally required.

/etc/HOSTNAME
Shows the host name of this host. Used for support of older programs since the hostname is stored in the /etc/sysconfig/network file.

/etc/inittab
Configuration file for init, controls startup run levels, determines scripts to start with.

/etc/inetd.conf
Sets up the services that run under the inetd daemon.

/etc/issue
Output by getty before the login prompt. Description or welcoming message.

/etc/issue.net
Output for network logins with LINUX version

/etc/ld.so.conf
Configuration file for ld.so, the run time linker.

/etc/lilo.conf
Configuration file for LILO.

/etc/limits
Limits users resources when a system has shadow passwords installed.

/etc/localtime
In Debian the system time zone is determined by this link.

/etc/login.defs
Sets user login features on systems with shadow passwords.

/etc/logrotate.conf
Configures the logrotate program used for managing logfiles.

/etc/magic
The configuration file for file types. Contains the descriptions of various file formats for the file command.

/etc/motd
The message of the day, automatically output by a successful login.

/etc/mtab
A list of currently mounted file systems. Setup by boot scripts and updated by the mount command.

/etc/named.conf
Used for domain name servers.

/etc/networks
Lists names and addresses of your own and other networks, used by the route command.

/etc/nologin
If this file exists, non-root logins are disabled. Typically it is created when the system is shutting down.

/etc/nsswitch.conf
Name service switch configuration file.

/etc/passwd
The user database with fields giving the username, real name, home directory, encrypted password and other information about each user.

/etc/printcap
A configuration file for printers.

/etc/profile, /etc/cshlogin,/etc/csh/cshrc
Files executed at login or startup time by the Bourne or C shells. These allow the system administrator to set global defaults for all users.

/etc/protocols
Describes DARPA internet protocols available from the TCP/IP subsystem. Maps protocol ID numbers to protocol names.

/etc/rc or /etc/rc.d or /etc/rc?.d
Scripts or directories of scripts to run at startup or when changing run level.

/etc/rc.d/rc0.d
Contains files used to control run level 0. Usually these files are softlink files.

/etc/rc.d/rc1.d
Contains files to control run level 1. Scripts beginning with an S are for start, K for kill.

/etc/rc.d/rc.sysinit
Init runs this when it starts.

/etc/resolv.conf
Configures the name resolver, specifying the address of your name server and your domain name.

/etc/securetty
Identifies secure terminals from which root is allowed to log in.

/etc/services
Lists the network services that the system supports.

/etc/shadow
Shadow password file on systems with shadow password software installed. Shadow passwords move the encrypted password files from /etc/passwd to /etc/shadow which can only be read by root.

/etc/shadow.group
Systems with shadow passwords may have this file.

/etc/shells
Lists trusted shells. The chsh command allows users to change their login shell to shells listed only in this file.

/etc/skel/.profile
Can be used by administrator to set the editor environment variable to some editor that is friendly to new users.

/etc/sudoers
A list of users with special privileges along with the commands they can execute.

/etc/smb.conf
The configuration file for setting up Samba services.

/etc/sysconfig/amd
Used to configure the auto mount daemon.

/etc/sysconfig/clock
Used to configure the system clock to Universal or local time and set some other clock parameters.

/etc/sysconfig/i18n
Controls the system font settings.

/etc/sysconfig/init
This file is used to set some terminal characteristics and environment variables.

/etc/sysconfig/keyboard
Used to configure the keyboard.

/etc/sysconfig/mouse
This file is used to configure the mouse.

/etc/sysconfig/network-scripts/ifcfg-interface
Defines a network interface.

/etc/sysconfig/pcmcia
Used to configure pcmcia network cards.

/etc/sysconfig//routed
Sets up dynamic routing policies.

/etc/sysconfig/static-routes
Configures static routes on a network.

/etc/sysconfig/tape
Used for backup tape device configuration.

/etc/X11/XF86Config
The configuration file for the X server.

/etc/syslog.conf
Configuration file for the syslogd daemon.

/etc/termcap
The terminal capability database. Describes by what “escape sequences” various terminals can be controlled. See terminfo, termcap, curs_termcap man pages.

/etc/terminfo
Details for terminal I/O.

/etc/usertty
This file is used to impose special access restrictions on users.

$HOME/.bashrc
User aliases, path modifier, and functions.

$HOME/.bash_profile
Users environment stuff and startup programs.

$HOME/.bash_logout
User actions to be done at logout.

$HOME/.hushlogin
When this file exists in the user’s home directory, it will prevent check for mail, printing of the last login time, and the message of the day when the user logs in.

$HOME/.inputrc
Contains keybindings and other bits.

$HOME/Xrootenv.0
Has networking and environment info.

/proc/cpuinfo
Information about the processor such as its type, make and performance.

/proc/devices
A list of devices configured into the currently running kernel.

/proc/dma
Shows which DMA channels are being used at the moment.

/proc/filesystems
Filesystems that are configured into the kernel. The file used to detect filesystems if the /etc/filesystems does not exist.

/proc/ioports
Shows which I/O ports are in use at the moment.

/proc/interrupts
Shows which interrupts are in use and how many of each there have been.

/proc/kcore
An image of the physical memory of the system.

/proc/kmsg
Messages output by the kernel. These are also routed to syslog.

/proc/ksyms
Symbol table for the kernel.

/proc/loadavg
The load average of the system.

/proc/meminfo
Information about memory usage, both physical and swap.

/proc/modules
Which kernel modules are currently loaded.

/proc/mounts
Contains information on filesystems currently mounted, similar to /etc/mtab

/proc/net
Contains status information about network protocols.

/proc/self
A symbolic link to the process directory of the program that is looking at /proc. When 2 process look at proc, they get different links.

/proc/stat
Various statistics about the system such as the number of page faults since the system was booted.

/proc/uptime
The time the system has been up.

/proc/version
The kernel version.

/tmp/fvwmrca01339
FVWM-M4 defines. Contains networking, Xwindows, other setup info.

/usr/lib/zoneinfo
Time zone datafiles are stored here on the Debian system

/var/log/lastlog
Used by finger to tell when a user was last logged in.

/var/log/wtmp
Binary info on users that have been logged on. The last command uses this info.

/var/run/utmp
Contains information about users currently logged in. Who and w commands use this file.

/var/named/root.hints
Used for domain name server. Placed here optionally, but this is the normal location.

/var/named/*
Files used by domain name server. Placed here optionally, but this is the normal location.

/var/log/btmp
Used to store information about failed logins. This file must be first created to activate it.

/var/log/lastlog
Contains information about the last time a login was done on the system. Works with lastb(1).

/var/log/maillog
The normal system mail log file.

/var/log/messages
The main system message log file.

var/log/secure
System tracking of user logins. Check this file periodically.

/var/spool/mail
Where mailboxes are usually stored.

Read More