After the exam I would say that 2 weeks is enough if you have knowledge of common configuration of linux computers. I mean not only the simple installation of nowadays distributions but the manual installation steps beginning with creating partitions until configuration the X files.
I/Os:
As important file is here named /proc/pci but this file doesn't exist in my Ubuntu distribution.
IRQ 0 Timer
IRQ 1 Keyboard
IRQ 2 IRQ-Cascading to communicate with IRQ 8-15
IRQ 3 /dev/ttyS1 alias com2
IRQ 4 /dev/ttyS0 alias COM1
IRQ 5 /dev/lp1 alias LPT2
IRQ 6 Floppy controller
IRQ 7 /dev/lp0 alias LPT1
IRQ 8 RTC (real time clock)
IRQ 9 free
IRQ 10 free
IRQ 11 free
IRQ 12 free or PS/2 mouse
IRQ 13 free
IRQ 14 first IDE controller
IRQ 15 second IDE controller
Important things:
Information about current assignment: /proc/interrupts and /proc/ioports and "lspci -vv"
8-Bit-scsi has three address lines. So we have 2^3=8 IDs. The controller gets ID 7 and devices 0-6. Make clear if you being asked for number of ids or devices.
16-Bit-scsi has four address lines. Controller gets also ID 7.
Information files: /proc/scsi/scsi Programs: scsi_info
Device names:
/dev/scdX
/dev/srX
/dev/sdXN
/dev/sgX
/dev/stX
/dev/nstX
with the program pnpdump we get the configuration and then we write it down into /etc/isapnp.conf i.e. the i/o addresses and interrupts that the pnp card uses. At last we use this properties with program isapnp to activate pnp card.
$ sudo hdparm /dev/hda Password: /dev/hda: multcount = 16 (on) IO_support = 0 (default 16-bit) unmaskirq = 0 (off) using_dma = 1 (on) keepsettings = 0 (off) readonly = 0 (off) readahead = 256 (on) geometry = 65535/16/63, sectors = 117210240, start = 0 hdparm -c1 /dev/hda
hdparm -d1 /dev/hda
hdparm -d0 /dev/hda
hdparm -I /dev/hda
or
hdparm -i /dev/hda
HCF Modems are special modem devices for windows os. Therefore they use specific drivers and so they are often not useable under linux.
With
setserial
you can set the speed of the communication with the serial interface. Wrong speed properties lead to wrong communication and many lost characters.
To connect usb devices to your computer there exists "hotplug" which is also used for pcmcia, firewire devices. Some distributions use "usbmgr".
The kernel modules are called "usb-uhci (Universal Host Controller Interface) for intel and via chipsets and "usb-ohci" (Open Host Controller Interface) for all the other chipsets.
common question from this part:
/bin /sbin /lib /etc /dev
These partitions have to be placed into the root partition. The installation needs at least two partitions: "/" and "swap" partition. Own Partitions are recommended for
/var /home /boot # as first partition if boot manager is lilo to solve 1024 cylinder problem
Combination of one of the first pair with one from the last pair is also possible. "/home" can be declared as "variable shareable". For this reason we have execution files in /bin as well as in /usr/bin. We have to prevent some files like "mount" in /bin or a mount of /usr partition cannot be made because the binary lies in the partition that we want to mount.
LILO stores the position of kernel and necessary files by means of sector addressing of the hard disk. Therefore lilo has to be reinitialized each time any file has changed a little bit. It is unindependently from naming because lilo does not use inodes to find the file like grub does. Grub uses the common file systems like ext2/3 or reiserfs to get the files. Therefore it is not necessary to reinstall grub into mbr after changing any file in /boot directory.
LILO Errorcodes:
After the bios starts the code in the mbr. Lilo as well as Grub have only a small part in the mbr part. With this small part they load the second part from /boot which loads the kernel into memory.
grub-install
install (hd1,1)/boot/grub/stage1 d (hd2) (hd1,1)/boot/grub/stage2 p (hd1) (hd1,1)/boot/grub/menu.lst
or with
#grub grub>root (hd1,1) grub>setup (hd1)
lilo
Important files:
tar -xzf source.tar.gz
or
gunzip source.tar.gz; tar xf source.tar ./configure make make install
or
./configure && make && make install make clean gzip -d tux.gz gunzip -d tux.gz
With gzip you can also compress a stream of data but not pack files into a package. For this cases we have "tar".
Options for "tar":
To decrompress file with means of pipes use:
$bunzip2 src.tar.bz2 | tar -xv -
Default parameters for "./configure" script is for example "--with-prefix=/usr/local" which means that the installtion path is "/usr/local".
Default rules for make files:
shared objects: *.so
ldd /bin/echo linux-gate.so.1 => (0xffffe000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7e19000) /lib/ld-linux.so.2 (0xb7f5e000)
File /etc/ld.so.conf define where the system search for libraries. Some distributions use also files from /etc/ld.so.conf.d/. No prevent searching whole list of pathes it exists an cache. With "ldconfig" you can bring this cache up to date.
ldconfig
Additionally the variable LD_LIBRARY_PATH gives pathes which will be searched for necessary libraries.
Important:
dpkg -i
dpkg -r or dpkg --remove
dpkg -l
dpkg -l 'gnome*'
dpkg -L package
dpkg -S pattern or dpkg --search pattern
dpkg -P package
dpkg -s package or dpkg --status package dpkg -E
dpkg -G
dpkg -R
apt-get update
apt-get upgrade
dselect
alien
Config files:
Important files:
-i --install
-e --erase
-U --upgrade
rpm -i package.rpm --test
--force --nodeps
--oldpackage
-V --verify
-K --checksig
-q --query
-ql
-qc
-qd
-qi
-qa
-qf file
$rpm -qf /usr/bin/passwd shadow-4.0.2-205
If the package will be installed later you can add option "p" to the commands above. "-p packagename" means that the search will not go through installed packages but through files of packagename.
-c --configfiles
-d --docfiles
-l package --liste package
-R --requires
-i (with q as -qi, not -i as --install)
--rebuilddb
Important files:
If you start with a login shell bash searchs for the following files in the given order:
The file ~/.bashrc is only for shells which were interactive meaning that they were start during execution of another shell.
Important things:
Here is basic knowledge of bash or sh necessary like variable declaration, variable exporting, usage of history as !-5 or !234.
env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]
Important things:
$cut -option file $cut -c5 <file>
$cut -c5- <file>
$cut -c5-10 <file>
$cut -c1,3,5,7 <file>
We can also define a delimiter. That is practical for csv files where the delimiter is the ";" character. The delimiter devide a line into parts or better called as fields. To define the delimiter we have option "-d" and the fields we want to see will be defined with "-f". By default is the delimiter the tabulator \t.
$cut -d\; -f1,3 file.csv
By default it transform one tab to eight space characters. You can choose how many characters one tab should be with option "-" and then the number of spaces. For example to transform tab to four spaces use:
expand -4 main.c
"-0" is not possible. To delete tabs from file use "tr".
fmt - simple optimal text formatter
SYNOPSIS
fmt [-DIGITS] [OPTION]... [FILE]...
DESCRIPTION
Reformat each paragraph in the FILE(s), writing to standard output. If no FILE or if FILE is ‘-’, read standard input. Mandatory arguments to long options are mandatory for short options too. -c, --crown-margin preserve indentation of first two lines -p, --prefix=STRING reformat only lines beginning with STRING, reattaching the pre‐ fix to reformatted lines -s, --split-only split long lines, but do not refill -t, --tagged-paragraph indentation of first line different from second -u, --uniform-spacing one space between words, two after sentences -w, --width=WIDTH maximum line width (default of 75 columns) --help display this help and exit --version output version information and exit With no FILE, or when FILE is -, read standard input.
-n, --lines=[-]N print the first N lines instead of the first 10; with the leading ‘-’, print all but the last N lines of each file
$hexdump -C a.avi | head 00000000 52 49 46 46 90 54 de 01 41 56 49 20 4c 49 53 54 |RIFF.T..AVI LIST| 00000010 8c 20 00 00 68 64 72 6c 61 76 69 68 38 00 00 00 |. ..hdrlavih8...| 00000020 57 82 00 00 00 00 00 00 00 00 00 00 10 01 00 00 |W...............| 00000030 84 03 00 00 00 00 00 00 02 00 00 00 00 00 00 00 |................| 00000040 80 02 00 00 e0 01 00 00 00 00 00 00 00 00 00 00 |................| 00000050 00 00 00 00 00 00 00 00 4c 49 53 54 1c 10 00 00 |........LIST....| 00000060 73 74 72 6c 73 74 72 68 38 00 00 00 76 69 64 73 |strlstrh8...vids| 00000070 4d 4a 50 47 00 00 00 00 00 00 00 00 00 00 00 00 |MJPG............| 00000080 e8 03 00 00 12 75 00 00 00 00 00 00 84 03 00 00 |.....u..........| 00000090 5b c4 00 00 10 27 00 00 00 00 00 00 00 00 00 00 |[....'..........|
$cat test1 testfield1 testfield2 $ cat test2 testfield1 testfield2fromtest2 $ join test1 test2 testfield1 testfield2 testfield2fromtest2
nl -s '.) ' linearerKongruenzGenerator.c | head 1.) #include <stdio.h> 2.) #define OBERGRENZE 10 3.) #define MAX_LOESUNGEN 100 4.) /* 5.) unsigned in ggT(unsigned int a, unsigned int b); 6.) unsigned in euclid(unsigned int a, unsigned int b); 7.) */ 8.) unsigned int euclid(unsigned int a, unsigned int b)
$cat test1 test2 testfield1 testfield2 testfield1 testfield2fromtest2 $ paste test1 test2 testfield1 testfield2 testfield1 testfield2fromtest2
$cat test1 test2 testfield1 testfield2 testfield1 testfield2fromtest2
2007-02-27 17:57 test1 Page 1 testfield1 testfield2 2007-02-27 17:58 test2 Page 1 testfield1 testfield2fromtest2
sed s/./A/
sed s/\\./A/
sed s/\\/x/ (without use of bash)
sed s/\\\\/x/
-n (numerical) -f (no difference between lower and capital characters) -r (reverse order) -n -r (reverse numerical order) -c (test if file is sorted and returns errorlevel 1 if not) -u (no double occurence of lines)
Without any parameters "split" creates pieces of 1000 lines.
$split -100 logfile.log $ls xaa xab xac xad
$for file in `ls x* | sort`; do cat $file >> newlogfile.log;done
Let us assume that we have a file of size 3 gigabyte. We want to split this into pieces of size 700 megabyte to burn them onto cds.
$split -b 700m filesize3gb.tgz
$cat filesize3gb* > hugefile.tgz
"tac" prints out the last line first then the second last line and so on.
$tail -20 messages
$tail +100 messages
$tail +100 -r messages
If you want to redirect stdout to a file and want to see simultaneous stdout on screen "tee" is the right tool.
$du -bc | sort -n | tee bytesorted.log
-a change the access time -c if file does not exist it will not be created -m change the modified time
echo "Hello World" | tr [:upper:] [:lower:]
tr - translate or delete characters tr [OPTION]... SET1 [SET2] Translate, squeeze, and/or delete characters from standard input, writing to standard output. -c, -C, --complement first complement SET1 -d, --delete delete characters in SET1, do not translate -s, --squeeze-repeats replace each input sequence of a repeated character that is listed in SET1 with a single occurrence of that character -t, --truncate-set1 first truncate SET1 to length of SET2 --help display this help and exit --version output version information and exit SETs are specified as strings of characters. Most represent themselves. Interpreted sequences are: \NNN character with octal value NNN (1 to 3 octal digits) \\ backslash \a audible BEL \b backspace \f form feed \n new line \r return \t horizontal tab \v vertical tab CHAR1-CHAR2 all characters from CHAR1 to CHAR2 in ascending order [CHAR*] in SET2, copies of CHAR until length of SET1 [CHAR*REPEAT] REPEAT copies of CHAR, REPEAT octal if starting with 0 [:alnum:] all letters and digits [:alpha:] all letters [:blank:] all horizontal whitespace [:cntrl:] all control characters [:digit:] all digits [:graph:] all printable characters, not including space [:lower:] all lower case letters [:print:] all printable characters, including space [:punct:] all punctuation characters [:space:] all horizontal or vertical whitespace [:upper:] all upper case letters [:xdigit:] all hexadecimal digits CHAR all characters which are equivalent to CHAR Translation occurs if -d is not given and both SET1 and SET2 appear. -t may be used only when translating. SET2 is extended to length of SET1 by repeating its last character as necessary. Excess characters of SET2 are ignored. Only [:lower:] and [:upper:] are guaranteed to expand in ascending order; used in SET2 while translat‐ ing, they may only be used in pairs to specify case conversion. -s uses SET1 if not translating nor deleting; else squeezing uses SET2 and occurs after translation or deletion.
Example: Replace linefeed with nothing.
cat linefeed.txt | tr -d '\012'
$wc test.txt 671 4168 26487 test1.txt
$wc -c test.txt 26487 $wc -w test.txt 4168 $wc -l test.txt 671
"wc" is able to get its input from stdin, pipe or through parameter.
"whereis" starts a search for a particular file or command and returns its full path and if possible its manual sites.
$find . -name "*.tmp" -print0 | xargs -0 rm
$ today=`date` $ echo $today Wed Feb 28 19:58:55 CET 2007
if test expression then
fi
or you can use the symbolic form of "test" with "[ expression ]":
if [ expression ] then # do something fi
The spaces inside the brackets are not a coincidence. After [ and before ] you have to place a space character. and also the expressions will be devided with a space character.
[ var1 -eq var2 ] [ var1 -ne var2 ] [ var1 -lt var2 ] [ var1 -gt var2 ] [ var1 -le var2 ] [ var1 -ge var2 ] if [ $# -ne 2 ] then echo "You have to give 2 parameters!" fi
As "test" we have a short form for let:
(( var1 == var2 )) (( var1 != var2 )) (( var1 < var2 )) (( var1 > var2 )) (( var1 >= var2 )) (( var1 <= var2 ))
Convert blanks in each FILE to tabs, writing to standard output. With no FILE, or when FILE is -, read standard input. Mandatory arguments to long options are mandatory for short options too. -a, --all convert all blanks, instead of just initial blanks --first-only convert only leading sequences of blanks (overrides -a) -t, --tabs=N have tabs N characters apart instead of 8 (enables -a) -t, --tabs=LIST use comma separated LIST of tab positions (enables -a)
Important things:
-d (no dereference)
-f (force)
-i (interactive)
-l (link)
-p (preserve attributes)
-R -r (recursive)
-s (symlink)
-u (update)
-v (verbose)
-Rpd or -a
Important things:
$cmd1 | cmd2
$cmd1 ; cmd2
$cmd1 && cmd2
$cmd1 || cmd2
$cmd1 & cmd2
$cmd > test.out or cmd 1>test.out
$cmd >> test.out
$cmd 2>error.log
$cmd &>output.log or cmd > output.log 2>&1
$cmd < intput.txt
$cmd << EOT input
$cat << EOM | mail user@localhost Subject: Hello <emptyline> Testemail <emptyline> <emptyline> EOM
$set -o noclobber $echo Test > test.txt bash: test.txt: cannot overwrite existing file $set +o clubber $echo Test > test.txt $_
Important things:
shows all processes that are stopped or running in the background.
fg <JOBID NOT PID!>
bg <JOBID>
ps -ef
ps aux
ends the given process.
kill <pid> kill %<jobid> kill -9 <pid>
kill -HUP <pid>
Important things:
nice -n 18 program
nice -18 <pid> nice -+18 <pid>
nice --18 <pid>
Important things:
.
^
$
?
+
*
Important things: vi / or ? h,j,k,l G, H, L i, c, d, dd, p, o, a ZZ, :w!, :q!, :e! :!
Questions:
Important things:
$ls -l $du -a
$ls -lr
$du -c
#fdisk -l Disk /dev/hda: 60.0 GB, 60011642880 bytes 255 heads, 63 sectors/track, 7296 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
/dev/hda1 1 7166 57560863+ 83 Linux /dev/hda2 7167 7296 1044225 82 Linux swap / Solaris
To start partition tool fdisk just give as parameter the hard disk device.
fdisk /dev/hda m
n
To define a file system in a partition use mkfs. By default it creates type ext2. Alternatively you can use option -t or use mkfs.reiserfs. For ext3 use mkfs.ext3 or "-t ext3". For windows file system use mkfs.vfat.
mkfs -t reiserfs
For swap partitions we have:
If you have forgotten to create space for a swap partition you can create a file as swap "device".
dd if=/dev/zero of=/var/swap bs=1024k count=128
chmod 600 /var/swap mkswap /var/swap swapon /var/swap
To view all swap devices which are being used:
$ cat /proc/swaps Filename Type Size Used Priority /dev/hda2 partition 1044216 101804 -1
Important things:
From time to time every file system should be tested with fsck or for ext2/3 with program e2fsck.
fsck -s (serialize)
-A (all)
-N (no operation/NOOP)
-p (preen) or -a (automatic) (latter is deprecated)
Important things:
mount /dev/hda5 /mnt/tmp
mount
df -h
To unmount partition from file system use
umount /dev/hda5
or
umount /mnt/tmp
To do this automatically create an entry in /etc/fstab. A line as follows mounts partition 5 to /mnt/tmp at the system start.
/dev/hda5 /mnt/tmp ext3 defaults 0 0
Another example:
# <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0 /dev/hda1 / ext3 defaults,errors=remount-ro 0 1 /dev/hda2 none swap sw 0 0 /dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
"defaults" means "rw"+"auto" for automatically mount at boot.
The dump column defines for data backup if partition is to be stored or not (1 or 0).
The last column gives the order for a system check after a system crash (2-9).
Swap partitions get mount point "none" and type "swap" as well as options like "sw" and "prio=42" which defines the priority.
The options "usrquota" and "grpquota" are for user quotas.
"devpts", "proc", "usbdevfs" are for internal functions.
For cd-roms we have "noauto" because the device doesn't contain always medias at the start of the system. "user" means that a normal user can mount the partition what make sense for cdrom devices. Option "user" implies that if a specific user mounts a partition only this user can umount the partion again. Option "users" implies that every user can mount and any other user can umount this partition. "exec" is used to are able to execute programs on cd media.
Important things:
This starts with entries in "/etc/fstab". In particular the options "usrquota" and "grpquota" are of importance. /etc/fstab:
/dev/sda6 /var reiserfs usrquota,grpquota 1 2 mount -o remount /var
quotacheck -avugm
edquota
Filessystem blocks soft hard inodes soft hard /dev/sda6 2243 150000 200000 1 0 0
quotaon
repquota
quota
The limit that reaches first its limit counts. That means that a user cannot write any more if its group limit has been reached although his own limit has not been reached.
There must exist two files in the root level of the partition that you want to mount with quota rules. Once "quota.user" and "quota.group" both with rights 600.
Important things:
rwxrwxrwx
Sticky bit means for a directory that its files can only be removed from its owner. That makes sense for /tmp. To be recognized as "t" at the position of "x" from others.
For group directories we have SGID (Set Group ID Bit) which appears as "s" instead of "x" at group position. That means that every new file in this directory has the ownership of the group not of the creator. Assigned to a file means that its execution process gets the identity of its group not from the user that execute the file.
SUID (Set User ID Bit) appears as "s" at "x" position of the owner. It brings up the execution process under identity of the owner of the file not from the user that execute the file.
"S" or "T" means that the execution right is missing. That does not make very sense.
To set these sticky bits use a four digit value with chmod:
$ chmod 1100 test ; ls -l test ---x-----T 1 micki micki 0 2007-02-22 17:29 test $ chmod 2100 test ; ls -l test ---x--S--- 1 micki micki 0 2007-02-22 17:29 test $ chmod 4100 test ; ls -l test ---s------ 1 micki micki 0 2007-02-22 17:29 test $ chmod 4400 test ; ls -l test -r-S------ 1 micki micki 0 2007-02-22 17:29 test -r-------- 1 micki micki 134 2006-12-17 16:32 blacklist.txt $ chmod o+w blacklist.txt ; ls -l blacklist.txt -r------w- 1 micki micki 134 2006-12-17 16:32 blacklist.txt $ chmod g+x blacklist.txt ; ls -l blacklist.txt -r----x-w- 1 micki micki 134 2006-12-17 16:32 blacklist.txt $ chmod u+x blacklist.txt ; ls -l blacklist.txt -r-x--x-w- 1 micki micki 134 2006-12-17 16:32 blacklist.txt $ chmod u-r blacklist.txt ; ls -l blacklist.txt ---x--x-w- 1 micki micki 134 2006-12-17 16:32 blacklist.txt $ chmod a+r blacklist.txt ; ls -l blacklist.txt -r-xr-xrw- 1 micki micki 134 2006-12-17 16:32 blacklist.txt chmod 712 blacklist.txt ; ls -l blacklist.txt -rwx--x-w- 1 micki micki 134 2006-12-17 16:32 blacklist.txt
UMASK
$ umask 0044; touch test; ls -l test;rm test -rw--w--w- 1 micki micki 0 2007-02-22 17:11 test $ umask 0077; touch test; ls -l test;rm test -rw------- 1 micki micki 0 2007-02-22 17:12 test $ umask 0022; touch test; ls -l test;rm test -rw-r--r-- 1 micki micki 0 2007-02-22 17:12 test $ umask 0000; touch test; ls -l test;rm test -rw-rw-rw- 1 micki micki 0 2007-02-22 17:13 test
For directories and its "x" flag use the three digit parameter:
$ umask 000; mkdir test; ls -ld test;rmdir test drwxrwxrwx 2 micki micki 4.0K 2007-02-22 17:19 test $ umask 234; mkdir test; ls -ld test;rmdir test dr-xr---wx 2 micki micki 4.0K 2007-02-22 17:20 test $ umask 127; mkdir test; ls -ld test;rmdir test drw-r-x--- 2 micki micki 4.0K 2007-02-22 17:20 test
Some special attributes for ext2 file systems for example the immutable bit which can only be set by root. After it was set you cannot delete this file. To set this bit use "chattr":
chattr +i importantfile
lsattr importantfile
Important things:
After creation of a file, the owner is the current user. Only root is allowed to change its owner with
chown user filename
A normal user can only change the group definition of a file and this only if he is owner of the file and member of the new group.
chgrp users filename.txt
Important things:
ln -s destination source
To create an hard link we use also ln but without parameter. The destination cannot be an directory only a file. The os saves the content of a file in blocks on the hard disk. Inodes are deriving on this blocks. The inodes contain also additional informations like owner, access attributes, timestamp and so on. The hard link is a file that derives on the inode of the destination file. So the link keeps valid if the file is moved inside the same partition. Hard links are only valid inside the same partiton because each partition has its own inode management.
ln source destination ls -li 6153239 -rw-r--r-- 2 micki micki 66K 2007-02-21 10:14 destination 6153239 -rw-r--r-- 2 micki micki 66K 2007-02-21 10:14 source
$ ls -li blacklist.txt 6153522 -rw-r--r-- 1 micki micki 134 2006-12-17 16:32 blacklist.txt $ ln blacklist.txt hardlink1 $ ls -li blacklist.txt 6153522 -rw-r--r-- 2 micki micki 134 2006-12-17 16:32 blacklist.txt $ ln blacklist.txt hardlink2 $ ls -li blacklist.txt 6153522 -rw-r--r-- 3 micki micki 134 2006-12-17 16:32 blacklist.txt
srwx------ ... amavisd
chmod u+rwx,g+rw <filename>
and not
chmod u+rwx g+rw <filename> chattr a (append only)
c (compressed)
i (immutable)
s (secure deletion)
S (synchronous update)
u (undeleteable)
To set these attributes use:
chattr +a <filename>
chattr -a <filename>
Important things:
$which ping /bin/ping
$whereis ping ping: /bin/ping /usr/share/man/man8/ping.8.gz
$find / -type f -name '*.mp3'
$find -type f -iname '*~' -exec rm {} \;
$find ~ -mtime 2
$find ~ -atime -3
$find ~ -atime +3
means atime
mtime
ctime
find / -perm +6000
If file names contains spaces we have a problem if we put them through pipe to "xargs". A solution is to define the end of the file as zero character.
find / parameter -print0 | xargs -0 command
"xargs" has a parameter "-i" to define a pattern that stands for the name "xargs" gets from stdin. That is an advantage if you need the pattern twice for example if you rename the file.
xargs -ixxx mv xxx /tmp/rename-xxx < filelist.txt
$locate pdf
Use "updatedb" to update this database.
ls -l
d directory l symlink c character device b block device p fifo s socket
Important things:
/etc/X11/xorg.conf
XF86Setup
xf86config
xvidtune
.Xresources
Xorg -configure # automatic configuration
xorgcfg # graphical tool
xorgconfig # console tool
Results will be written to /etc/X11/xorg.conf. You activate the X server with "startx"
If the screen is a little bit hidden or if you want to change size of the viewed screen use "xvidtune". After you are happy with "xvidtune" this program returns a modeline like:
Modline "1280x1024" 166.29 1280 1392 1528 1744 1024 1025 1028 1077
The "xorg.conf" file is devided into sections. Each section begins with "Section" and ends with "End Section". The different types of section are the following ones:
The X font server "xfs" serves the font wishes of the X server. The config file is "/etc/X11/xfs.conf" or "/usr/X11R6/lib/X11/fs/config". With an entry as 'FontPath "tcp/192.168.100.1:7000"' in the Files section the X server tries to get the fonts from the specified server.
After installing new fonts you have to call "mkfontdir <path>" and "mkfontscal2 <path>" to be able using the fonts.
ATTENTION: it does not exist a section "Font"!
Important things:
The display manager presents a login dialog and after user login it starts a window manager like KWin (KDE), Metacity (Gnome). The well known display manager are XDM, KDM, GDM.
Configuration of the greetings message of login screen lies in "/etc/X11R6/*/Xresources". Inside this files we have values as "Client*Resource: value". For example to start xterm with a given geometry use "XTerm*geometry:90x40". Then xterm will be started each time with "xterm -geometry 90x40".
The protocol "XDMCP" (X Display Manager Control Protocol) is for remote access over network. After that you can take an old rusty pc and call the X with "X :0.0 -query <host>" where host is the one that should serve the data. After that you are working on the old pc with X which comes from the host over network. The old pc takes only the input from keyboard and mice and sends it to the host. For that reason the remote host must be a strong processing unit, if it has to process different user over network.
/usr/X11R6/bin/gdm (binary) /usr/X11R6/lib/X11/xdm (config file)
To allow remote connections you have to uncomment the following line in xdm config file with a "!":
DisplayManager.requestPort: 0 !DisplayManager.requestPort: 0
Config files under "/etc/X11/gdm".
defaults.conf custom.conf
To adjust these files you can use "gdmsetup".
kdmrc (config file under KDE_DIR/share/config/kdm)
Important things:
Window Manager:
To adjust these use file "~/.Xdefaults". The syntax is as follows:
program.class.resource: value
"class" means for example "Geometry" for common properties for window size and window position.
xterm*Background: black
xhost +192.168.0.2
xeyes -display tux:0.0
In the file "/etc/inittab" we have the entry "id:3:initdefault:" which says that 3 is the default run level. The entry "x:5:respawn:/usr/sbin/kdm" starts kdm in run level 5. "respawn" means that kdm is called again after a crash.
To modify the message the console shows if it appears as "Ubuntu feisty (development branch) \n \l" you can modify the text inside the file "/etc/issue".