Linux User's Guide
GNU/Unix and XWindows Commands
Version 1.2 19/8/2003 by Samar
- Linux Distributions
- FS Mgt (a. Navig'n, b. File Display,
c. File Search and Location, d. File Permissions,
e. FS Hierarchy Standard) {LPI-101}
- Text Processing (Text Editors, Text Utilities, Printing,
Latex & Tex/Type-Setting) {LPI-101; LPI-102}
- Documentation {LPI-101}
- System Management (Process Management + System
Status Cmds, Time and Host Status)
- Internet (Communication Tools)
- XWindows (XWindows, File System, Personal Mgmt)
- Multimedia (Graphics, Audio, Video, Games)
- Desktops (Gnome, KDE) {SkillDrill:"Gnome Implementn"}
0.
Linux Distributions
I.
File System Management
Conventions:
squares = files or env. vars;
disc = example commands/cmd line options;
circle = subcmds.
a.
Navigation: Working with Files, Directories and Links
ext2 Filenames can be up to 256 characters in length,
may include small and capital letters, numbers and
other characters, such as -, ., _. Files can be delimited by any printable
character. A dot `.' indicates a relative path (eg ./ or ../)
not an absolute one.
Login
- passwd =
Gnome Icon > Programs > System > Change Password
- 6 < passwd < 255 chars + contain at least 1 alphanumeric
char + no dict word + no login id + not like current passwd
- User Info who, w, users
- $whoami -> samar
- $who am i -> alpha.iopb.in!abbas
pts/2 Jul 29 21:15
- $groups -> floppy xgroup
- $rusers (remote users)
- $id
-> uid=254(abbas) gid=201(xgrp) groups=201(xgrp)
- Virtual Consoles = default 6 virtual
consoles: Ctrl-Alt-F[1-6]; Ctrl-Alt-F7 = X if running
Directories
- cd (`change dir')
-
$cd = $cd ~ = $cd
~abbas (return to home dir $HOME)
- $cd - (goto previous dir $OLDPWD)
[rh033,3-4]
- mkdir (`make directory')
- -m ijk (`mode') | -p (make `parent'
dir's)
-
$mkdir -m 700 d
(close new directory for all other users)
- $mkdir -p {d1,d2}/{sd1,sd2}/{ssd3,}
(create parent dirs d1/sd1/ssd3, etc.)
- rmdir (`remove directory' if
empty;
rm -r|rf to remove non-empty dirs)
- -p (`parent': remove empty parent dir's)
-
$rmdir d
(remove directory d)
- df (report `disk filesystem usage'
in units of 1024 bytes + info re. disk partitions and
mount points]
- -a (all) |
-i (`inode' usage) | -k (`kB') |
-m (`MB') | -h (`human-readable') |
-t nfs|hsfs|cdfs|pcfs (`type':
nfs, High Sierra cdrom,
HP-UX cdrom or MSDOS fs) |
-T (`type' of each fs shown) |
-x nfs (`eXclude' fstype)
- $df -m -t nfs
(show usage in MB of mounted NFS filesystems)
- $df -h (o/p in k, M, G)
- du (report `disk usage'
of current/specified
directory in units of 1024 bytes)
- -a (`all' files' info, not just dir's) |
-b (`bytes' not default kB) |
-k (`kilobytes'; default) |
-h (`human-readable' size letters) |
-H (`Human-readable'; but powers of 1000 not 1024) |
-m (`MB') |
-s (`summarize') |
-D (`dereference' symbolic link + show their dir. usage)
- HP-UX reports sizes twice the correct BSD NFS sizes
-
$du -D /usr/slnk
(`show directory usage of symbolic link')
- $du -ak
(show directory and all file sizes in kB)
- $du -sh
(space, human readable)
- tree (`show directory tree')
- -a (`all' files, incl. hidden files) |
-d (`dir's' only) | -f (`full path prefix') |
-n (`no color') |
-p (show `permissions') |
-s (`size') |
-u (print `username' else uid) |
-g (`group name' else gid) |
-q (`question mark' for non-printable
char's in filenames not default carets) |
-t (sort by `time modified' instead of alphabetically) |
-C (`color on') |
-D (`date' of last modification time) |
-F (indicate `file type':
/ dir, * exec., = socket files) |
-N (show `non-printable' char's in filenames as is) |
-P *.txt (list only files matching `pattern')
-
$tree
(show directory tree)
-
$tree -s
(show sizes of tree files)
-
$tree -ns | less
(pagewise display of hierarchy with sizes and without color)
- pwd
(`print working directory') [kamran.139]
Files
- cp (`copy')
- -f (`force' overwrite) |
-i (`interactive': prompt before overwrite) |
-l (make hard `links' instead of copies of files) |
-p (`preserve' owner, perm's and timestamps) |
-r (`recursively' cp whole dir trees) |
-R (`recursively' cp whole dir trees) |
-s (make `symbolic links' instead of copies of files) |
-u (`update': overwrite old files only) |
-v (`verbose': print name of each file
before cp'g it)
-
$cp ../dir/f.txt .
(copy file f.txt in a directory dir under the superdirectory
to the present dir)
-
$cp -a d1 d2
(cp entire dir tree, preserving modif times;
$cp -R d1 d2 cp's dir tree but changes modif times)
- mv (`move' - actually renamg
file)
- -f (`force' overwrite) |
-i (`interactive')
- $mv f1.txt f2.txt;
$mv dir1 dir2; $ls -i
(move file/dir, verify inode is same)
-
$mv f1.txt ~surya/dir/subdir
(move file to a subdir in /home/surya)
- rm (`remove')
- -f (`force' overwrite) |
-i (`interactive') | -r / -R (`recursive')
-
$rm -- -f or $rm ./-f
(remove file called -f)
-
$rm *.d??
(erase all files having a three-lettered suffix
followed by two char's)
-
$rm -r cache/
(recursively remove all files and subdir's
of a dir called cache, cf. -rf option)
- touch (
update file time stamp, or create a new empty file)
- -a (change `access' time only) |
-c (`creation-no': do not create non-existent
files) |
-d mmddhhmm (use given `date') |
-t mmddhhmm (use given `time' instead of current time)
- $touch {hello,bye}.{txt,tex,blk}
(create multiple files)
Links
- stat
(show meta-data in inode; $stat /etc/passwd;
$ls -i show inode no)
- ln
(create links between files)
- -s (make `symbolic/soft link' not hard one)
-
$ln f hl.lk; ls -i; ls -l; rm f
(create hard link; hard link still exists!)
-
$ln -s f sl.lk; ls -i; ls -l; rm sl.lk
(create symbolic/soft link instead of hard link; test with
$ls -i and $pico new.lnk ; link only erased not
old.txt)
Definition of Hard Link : -
Another name for an existing file.
- link and the original share the
same inode (indexed node no.) containing all meta-data (data about data)
about the
file.
- hard links to directories are not possible
- hard links cannot cross FS boundaries/partitions
- [ file's inode = HD's MBR = partition's superblock ] (all
are areas set aside to contain meta-data about the device)
- file present in FS as long as 1 hd ln remains
Hard Link: /\/\ Soft Link: /\
/ /\ \ / /\ /\
/ /in\ \ / /in\ /in\
\ \od/ / \ \o1/ \o2/
\ \/ / \ \/ \/
\/\/ \/
Definition of Symbolic/Soft Link : - A special linux file
type actually referring ie. pointing to a different file. [info ln]
- soft link is a file type;
- soft links can span FS/HD boundaries (unlike HL)
- soft links to dirs possible (unlike HL)
- some properties not fooled by soft links
- file being linked neednot exist
- perm(SL) = 777 always & default
- size of SL = no. chars of target filename
- not supported by older system kernels (eg. Sys.V.3)
|
b.
File Display
Listing, Viewing and Displaying Files.
- ls (`list'
contents of dir)
-
-a (show `all' files, incl. hidden dot files) |
-l (`long' listing) |
-R (`recursive' listing of subdir's) |
-t (sort by modif'n `time') |
-r (`reverse' sort) | -i (`inode' no)
-
$ls -la
(long listing of all files, eg.:)
drwxr-xr-x 18 abbas user_loc 1024 Sep 19 17:03 Dinosaur
-rw------- 1 abbas user_loc 11565 Mar 25 2001 permian.txt
This output consists of [welsh.85]:
- File type field
- Permission Fields
- Number of Hard Links
- Owner
- Group
- Size in Bytes (for dir's, the bytes used to store dir
info)
- Date and Time of Last Modification
- Name of the file/dir
File-type subfield : The first subfield [welsh.202] -
-
- : ordinary file
-
d : dir
-
l : symbolic link
-
b : block dev special file
-
c : character dev special file
-
$ls -lR | less
(long listing of subdir's piped to less)
-
$ls --color /dev
(list c|b files in color)
- last modifd time: $ls -l;
last-access t $ls -lu; inode change t $ls -lc;
creatn time not stored
- /etc/DIR_COLORS or
~/.dir_colors - provide the colors for $ls
[welsh.84] [info tree has ~/.dircolors]
- $LS_COLORS
- $LS_COLORS=*.tex=1:*.html=34:*.txt=35; export LS_COLORS
which can also be set via $dircolors)
cat (`concatenate'
files and prt to o/p; simplest txt editor)
tac (`reverse concatenate')
-
-r (treat separator as `regex')
head
(output the first part of file, first 10 lines by default)
-
-c n (print first n char's)
-
head does not have a + option unlike tail [ce.lpi]
-
$head -c 5 f.txt
(display first 5 char's of file)
tail
(output the last part of file, last 10 lines by default)
- -n n (display `number' of last n lines)
- $tail -5 f.txt
(or $tail -n 5 f.txt )
(display last 5 lines of file)
- $tail +3 f.txt
(show last 8 lines of 10-line file)
- #tail -f grow.txt
(continuously monitor file in real-time;
exit with ^C); %tail -7f x.txt
(continuously monitor, starting with last 7 lines;
%tail -f -5 x.txt :gives error)
-
#tail -f /var/log/messages | more
(continuously monitor file;
shows user login and logout)
more (pagewise text-viewing program,
deprecated in favour of less)
- -n (show `number' of rows)
-
SPACE (`forward' one screenful) |
b or ^B (`back' one screenful) |
/ (`search' pattern) |
n (`repeat' last search forward) |
. (repeat last command) |
v (start `vi') |
' (goto beg'g of file; fwd apostrophe) |
= (show line number)
-
$more -25 f.txt
(display 25 rows of file at a time)
less (`less is not less than
more')
- -c (`clear' screen before display) |
-i (`ignore' case; default case-sensitive) |
-r (`raw' ctrl chars. to be displayed) |
-s (`squeeze' multi blank lines into single one) |
-V (`version')
-
SPACE (`forward' one screen) |
ENTER (goto next line)
b = ^B (`back' one screen) |
f = ^F (`forward' one screen) |
d = ^D (`demi' = half-screen advance) |
-
$less f.txt
file (`file type')
-
$file f.txt
(show the type of file, eg. ASCII)
c.
File Search and Location
:
Finding, Searching and Locating Files
- find
- -mtime +n|-n (modified time more than/less than n days) |
-atime +n|-n (accessed more than/less than n days ago) |
-name xpattern (filename) |
-iname xpattern (case-Insensitive match) |
-print (print to stdout) |
-prune (omit certain dir's) |
-size n (size in blocks, if `c' then in chars) |
-type b|c|d|p|l|s|f (blk dev, char dev, dir, fifo/named pipe,
sym.link, socket, plain file) |
-exec (exec. cmd on each file) |
-ok (confirm before exec)
- $find . -name '*.txt'
(search current dir tree for files ending in txt)
- %find . -name CVS -exec rm -rf {} \;
- $find . -name "*.html"
(search current dir tree for html files)
- $find /etc -type d -print
(show dir tree below /etc)
- $find /dev -type f -mtime -7 -exec ls -l{};
(show device files modifed in last 7
days)
-
$find . -type f -name "f.txt" -print
(find files named f.txt from present dir downwards
and print output to screen)
-
$find . -type d -name "mydir" -print
(find dir's named mydir from present dir downards
and print output to screen)
-
$find . -size +30k
(search current directory tree for files larger than 30k)
-
$find . -type f -print |xargs grep train
(find files containing string train)
-
$find / -mtime 1 -print > /tmp/filelist.daily
(find files modified in last one day, and
print to stdout; whence
$tar -cv -T /tmp/filelist.daily -f /dev/rft0
can back up these files regularly)
-
$find . -type f -name "f.txt" -exec rm {} \;
(remove file f.txt; {} = placeholder for filename \; delimits
generated cmds)
- $find . -type f -name "*.htm" | xargs grep Iranica
- locate (list files in databases
that match a pattern)
- slocate (`secure locate')
uses daily updated DB, so faster than find, but less powerful
- which
(show full path of commands; analog of $man -w ls
for man pages)
- grep
(`Global Regular Expression Parser':
search for lines matching a pattern; Kamran.133;
suited for search within files)
-
-i (`ignore case' in the pattern) |
-r (`recursive' searoh of all files in a dir
and its subdir's)
-
$grep -r -l "x=\"hi bo\"" * | less
(search recursively for x="hi bo", printg only filenames not line contents)
-
$grep " Hi world " *.txt
(search all files ending in txt for string specified
including blanks)
-
$grep -e '-some' *.???
(search all files with a three letters suffix for -some)
-
$grep -ri Samar mydir|less
(search all files in mydir and subdir's for
string Samar, ignoring case, piping output to less)
- fgrep (`fast grep':
search for lines matching a pattern, regex not permitted)
-
$fgrep myword *.txt
(search all files ending in txt for myword)
- egrep (`extended grep':
permits complex regex, does not accept braced or
tagged regex)
-
$egrep myword *.txt
(search all files ending in txt for myword)
- xargs (`execute arguments'
: execute command lines from standard input)
-
$ find . -name '*.txt' | xargs grep myword
(find all files in full directory tree ending in text,
piping the output to a match for myword)
- locatedb (`locate database')
- updatedb (`updates file name
databases used by GNU locate)
d.
File Permissions
setuid : -
set process' effective UID to that of file on exec; no effect on dirs,
4000,
; eg. ping must be suid root to send raw ICMP pkts over NW
[RH033,5-7]
setuid : -
set process' effective GID to that of file on exec; for dirs all files
created have same GID as dir irrespective of creator, 2000
sticky bit : - prevents users from deleting others' files, 1000
(eg. /tmp)
|
- chmod (`change mode')
- 2 ways exist of changing the mode:
- Symbolic mode (u=user, g=group, o=other, a=all); which cannot
cover all possibilities, whence:
- Absolute mode (r=4, w=2, x=1).
-
$chmod 744 *.txt
(allow user full permission, group read and other read)
-
$chmod +x *.txt
(allow execution to all levels)
-
$chmod =r *.txt
-
$chmod ug+rwx f.txt
(allow user and group to read, write and execute f.txt)
-
$chmod g+rw,o+r f.txt
(, not ;! others: read only, group: read and write)
- $chmod u+s xgroup (suid, 4000)
- $chmod g+s xgroup (sgid, 2000)
- $chmod o+t /tmp =
$chmod 1777 /tmp (sticky bit on; for dirs only)
- Relative Permissions :
who
a :all
g :owner's group
o :all others
u :just the user
|
operator
+ :add mode
- :remove mode
= :set mode absolutely
|
permission
x :execute
r :read
w :write
s :set user ID bit
t :set sticky bit
|
- chgrp (`change group')
- newgrp (switch to `new group')
- chown (`change owner')
-
$chown samar:xgroup f.txt
(change ownership; note that original users
cannot then do anything with the file!)
- umask (`user mask': set the
digits to be subtracted from full permission set: 666 {files}
or 777 {dir's})
- $umask 027
- umask(user) = 002 (default)
(user private groups; new files=664);
umask(root) = 022 (default)
e.
FHS (Fs Hierarchy Standard)
Definition of Root Directory : -
The dir which holds all other dir's;
the ultimate parent dir; the topmost dir
Def.of File System : -
A section of the HD/CD/FD/etc. formatted to hold files
[welsh.144]
Def.of Home Directory : -
The dir provided for each user, abbreviated as
~ = ~abbas = /users/abbas
Def.of Hierarchical FS : -
One tree of dir's.
|
The linux fs is often referred to as having a tree structure,
since dir's and sub-dir's branch off like limbs from the
single root dir [kamran.138].
Directory
|
Purpose
|
/
|
root dir
|
/bin
|
binaries dir for essential root + user sys cmd's;
requd for single-user mode.
|
/boot
|
locatn of kernel + other bootg files
|
/dev
|
device files: gateways to physical computer componts.
|
/etc
|
etcetera: config.files (usu. text).
|
/etc/skel
|
skeleton dir. with sample startup files
|
/home
|
users' home dir's; /usr, /users or /u in some dialects
|
/mnt
|
temporary mount point for sysadmin [rute]
|
/proc
|
window into kernel; a virtual fs
|
/sbin
|
system binaries usu.run automatically by the linux system.
|
/tmp
|
temp'y dir. for prog's requirg temp.files, usu. lost
between invocatns; likely lost betwn reboots.
|
/usr
|
user-oriented non-essential dirs.; without
host-specific data or t-varyg data.
|
/usr/bin
|
user-oriented linux programs
|
/usr/include
|
standd include files used by C, eg. stdio.h
|
/usr/lib
|
standd libs
|
/usr/lib/X11
|
X Windows src libraries
|
/usr/spool
|
queue dirs for various
processes (eg. mail, print, etc.)
|
/usr/sbin
|
superuser binaries
|
/usr/src
|
srcs of built-in programs
|
/var
|
variable data files, incl.
spool/ (files tobe printed),
mail/ (emails tobe sent),
uucp/ (tobe cp'd), admin.data (eg. logs); transient and
temp.files.
|
/var/spool
|
temporary storage
|
- /usr/src/linux/fs/ dir. lists the types of files
supported by the kernel.
- If /dev/MAKEDEV exists then devices can be created manually
as needed;
MAKEDEV.local is required for local devices.
II.
Text Processing
a.
Text Editors
- pico
(simple file editor with few commands, resembles
pine email program)
- -w (`word-wrap' disabled) |
-v (view-only) | -s ispell (spell checker) |
-x (eXclude keymenu at screen bottom)
-
^X (save+`eXit') |
^J (`justify' format paragraphs) |
^T (`thesaurus' spell checker) |
^R (`read' file) |
^W (`where is' search) |
^^ (set `control caret' block marker) |
^K (`kut' text block) |
^U (`unkut' text block) |
^O (write to `output file')
-
$pico -s /usr/bin/ispell -w f.txt = $pico -s ispell
-w f.txt
(edit f.txt usg alt spell-checker without wrapping)
- pilot
(file browser program used with pico;
$pilot . )
- sed (`stream editor')
- ^ (beg'g of line) |
$ (end of line)
- $sed "s/^$//" < myfile
(change empty lines to empty lines) [stocker]
- $sed -e '/^$/d' < myfile
(remove empty lines) [stocker]
- $sed -e s/Hello/World/g < f1 > f2 (global
replace)
- vi (`visual ex'): 3 Modes exist:
- Escape/Command Mode (enter via ESC)
- h, l (left, right) |
k, j (up, down)
- ^f (`forward' one screen) |
^b (`backward' one screen) |
^l (redraw screen)
- /myword (search fwd) |
?myword (search backwards) |
n (continue search)
- c (`change' text) | d (`delete') |
ndd (delete n lines) |
i (`insert' text) |
o (`open line below current in insert mode) |
O (`open line above current in insert mode) |
p (`paste' text = copy) |
r (`replace' single char) |
R (enter `replace text' mode) |
u (`undo' last change) | x (`excise' single char) |
y (`yank' = copy text) |
nyy (`yank' n lines into unnamed buffer) |
- Input/Insert/Append/Text/Edit mode (entered by
typing `i`=insert/input or `a`=append)
- Command-Line/Line/Colon Mode (`:`)
- :q! (`quit' without saving) |
:w (`write') |
:wq (`write and quit') |
:wq! (force-write to read-only file)
- :r f.txt or :%r f.txt
(`read'+insert external file into buffer)
- %s (entire file searched)
- :%s/world/Globe/g or :s/world/World/g
(global `search' and replace)
- :%s/^ / /g (replace lines beginning five spaces
with one space)
- :%s/\%/\#/g
(`search' :global search, escaping special characters)
- :g/^$/d (remove blank lines)
- :1,$s/^[ ]*// (remove leading blanks from all
lines)
- :%s/^/ /g (prepend five blanks to each line;
say after
$fmt -w 70 -s lpi102_c21.html > x.html; )
- :set number | :set nonumber |
:set all (show all set parameters)
- :g/^$/d
or :%s/^$/d
(delete blank lines)
-
$vi +10 f.txt
(place cursor on 10th line)
- ~/.exrc (vi run-command
file, eg:):
set number
set errorbells
set showmode
- vim (`vi iMproved' -
syntax colorg); cf. $vimtutor
- emacs, xemacs :
emacs makes use of two main keys: one control key
(^) and meta key (ALT, denoted by `m')
- ^X^C (`eXit') | ^S^X (`save'+ exit) |
^S (`search') | ^R (`replace') | ^X M (`mail') |
^C^C (send mail) | ^H (`help') |
^V (`vorwaerts' 1 screen) | mV (back 1 screen) |
^X U (`undo') | ^X^F (open `file') |
^C K (`kill') | ^SPACE (mark block) |
mW (copy block to internal clipboard) |
^Y (`yank') | ^W (`water out' or cut text) |
m< (jump to start of buffer) |
m> (jump to end of buffer) |
^H t (tutorial) | ^H k<KEY> (help on key funcn) |
^H i (info) [kamran.Ch.14]
- joe (`joe's own editor'):
A suite of five editors: joe, jstar, jmacs, rjoe, jpico
- ^KH (`help') | ^KX (`eXit'+ save) |
^Y (`yank') | ^KB (begin `block') |
^KK (end block)
- spell :
(spell checker)
-
$ spell f.txt
(lists wrong words only without correcting the original file;
this is linux aspell script mimicking the original
Unix spell)
-
$ ispell f.txt
(interactive spell checker, user simply enters number of
closest choice from matched words, `quit' to quit;
ispell can use personal dictionaries)
-
$ aspell -c f.txt or
$ aspell check f.txt
(linux spell checker)
-
$ aspell --help | less
(linux spell checker help)
- gedit (GTK+ based text editor)
- kedit (KDE text editor)
- nedit
- gnotepad+
( Foot > Programs > Applications > gnotepad+ )
- gvim (`Gnome vi iMproved')
Foot > Programs > Utilities > gvim
- gxedit (`Gnome X Editor';
a front end for html files)
- xedit
(simple text editor): -
Foot > Programs > Utilities > gnotepad+
or $/usr/bin/X11/xedit
- xjed
( `X Joe's editor'):
$xjed
or Foot > Programs > Utilities > xjed
b.
Text Utilities (GNU TextUtils Package)
- cat (simplest linux
text editor; cf. text editor section)
- cmp (`compare' 2 files)
- comm (`compare' 2 sorted files
line by line)
- csplit (`context split':
split file into context-determined pieces)
- cut (`cut' from each line in
file)
- -s - blank
(`squeeze' multiple blank lines') |
-n (`number' all non-blank lines)
-
$cut -f1,5 -d: /etc/passwd
( extract 1st and 5th fields of given file, using
semicolon as delimiter; shows userid and name )
-
$cut -d : -f 1,6-7 /etc/passwd
( extract 1st and 6th-7th fields of given file, using
semicolon as delimiter; shows userid, home dir. and default shell
)
- diff (`differentiate'
between two files)
- expand
(convert tabs into spaces)
- fold
(wrap input lines to fit in specified width)
- fmt (`format')
- -w n (`width') | -u (`uniform
spacing')
- $fmt -w 20 f.txt (or
$fmt --width=20 f.txt )
(width 20)
-
$fmt -u f.txt
(uniform spacing)
- $fmt -w 70 -s lpi102_c21.html > x.html; ;
use pico ^O to remove ^M etc., use vi to prepend blanks
- $fmt is equivalent to resizing the Xwindow
in pico and using ^L
- head
(cf. FS Navigation section)
- join (`join'
lines of two files on a common field;
files which have something in common)
(cf. paste)
- $join f1 f2
( join common lines )
- nl (`number lines')
-
-b a | pREGEX (`body-numbering': no. all lines or
only lines that contain a match for REGEXP) |
-i n (`increment' by no. n) |
-n ln | rn | rz (`number format')
-
$nl f.txt
(number lines)
-
$nl -i 5 f.txt
(number lines with increment 5)
-
$nl -n rn f.txt
(number lines right-no'd)
- od (`octal dump' to stdout)
- paste (`paste'
two or more files having nothing in common)
(cf. join)
- $paste f.txt g.txt
( join two file columnwise )
- $paste -d: f.txt g.txt
( join using : as delimiter )
- pr (`print':
prepare file for printing)
- $pr f.txt
(print file fully formatted to stdout, the screen)
- $pr -h "Samar's File" f.txt | lpr -Pdj2
(print file with heading `Samar's File' to printer named
dj2 = deskjet2 )
- $pr -4 -t l.txt
(print list in four columns, truncating header and footer)
- sort (`sort' file)
- -b (ignore leading `blanks') |
-u (`unique') |
-f (`force' sort upper- +lowercase
as if all uppercase) |
-n (`numeric order') | -xn (sort by number x) |
-r (`reverse') | -m (`merge') [lpi]
- $sort f.txt
( sort file )
- $sort +1 l.txt
( sort file, skipping first field; in case of a list
firstname lastname this will sort by last name)
- $sort +1 -2 l.txt
(skip one field before sorting, stop sorting after second
field)
-
$du | sort -rn
( largest files first )
-
$sort f.txt | mail -s "!" user@mars
( sort and mail )
- split (`split
large file into smaller files')
- $split f.txt
(split file into default of 1000-line chunks with file names
Xaa, etc. with default prefix = X )
-
$split -10 /etc/passwd X or
$split -l 10 /etc/passwd
(splits password file into files Xaa, Xab, Xac, etc
of ten lines each; the original file can be restored using
$cat X?? > full.txt)
- sum
(print checksum and block counts)
- tac
(inverse cate: concatenate and write files in reverse)
- tail (`inverse head':
cf. FS Navigation section)
- tee (`tee':
read from standard input and write to standard out-
put and files)
- $sort f.txt | tee f.sorted
( sort file, sending output to f.sorted )
- tr (`translate' chars, `trail
search')
- -d (`delete') |
-s (`squeeze' repeats)
- GNU tr does not support
System V syntax of [] for ranges; but GNU tr uses [] for character
classes
- $tr a-z A-Z < f.txt =
$tr [a-z] [A-Z] < f.txt =
$tr "[a-z]" "[A-Z]" < f.txt
(translate from upper case to lower case)
- $tr -d 0-9 < f.txt > o.txt
(delete all numbers from file, writing to new file)
- $tr -s x < f.txt
(squeeze repeated occurrences of x to one x)
- $tr [:upper:] [:lower:] < f.txt
(convert to lower case using character classes)
- $tr -d [:alpha:] < f.txt
(erase all alphabets in file)
- $tr -d [:blank:] < f.txt
(erase all blanks in file)
- unexpand
(convert spaces to tab)
- uniq (`unique':
remove duplicates from a sorted file)
- wc (`word count')
- -c (`characters' = byte count only) |
-m (print only char count) | -w (`word' count) |
-l (`line' count only) | -L (print length of longest line)
-
$wc f.txt
(count lines, words and characters of file f.txt)
-
$wc -w f.txt
(or
$wc --words f.txt )
(count words in a file)
-
$wc -l f.txt
(count lines in a file)
-
$wc -c f.txt
(or
$wc --chars f.txt )
(count characters in a file)
c.
Printing
- pr (`print'
files to std output)
-
$pr f.txt | less
(print files)
-
$pr -n f.txt
(print with numbered lines)
-
$pr -8 f.txt
(print file 8 characters wide)
- lp, lpr,
lpq, lprm (`line printer' cmds)
d.
Latex and Tex
- latex
- pdflatex
- tex
- xdvi
- dvips
- ghostview
- lyx - GUI front-end
for latex, pdf and html files.
- ps2ps (convert
between ps files) (cf ps2pdf, pdf2ps manuals)
- $ps2ps -dLanguageLevel=1 f.ps g.ps
- xpdf
(Portable Document Format file viewer)
- Scan to pdf: Adobe Acrobat (not just Reader) > Import/Scan
> SCAN_ACROBAT; Destination > New PDF Doc > Scan
- psmerge: concat ps files.
- $mpage -c|-4 f1.ps f2.ps > f.ps reportedly concats ps
- enscript : txt to ps
- $enscript -2 -Ecpp -r -v -d xprinter xfile (reportedly prt
src code)
- $encript -2rG f.txt (reportedly nice txt file)
- pdcat
(cf. www.pdf-tools.com); pdfpages )ki
III.
Documentation
- man (`manual')
- -w (where: only print location of man pages)|
-k xkeyword (keyword)
- /usr/man
- /man1: shell commands.
- /man2: system calls
- /man3: libc calls
- /man4: device definitions.
- /man5: file format.
- /man6: games
- /man7: system files
- /man8: root utils.
- /usr/doc : third party software
manuals; eg. /usr/doc/alsa-2.11/
- /usr/share/doc/HOWTO: HOWTOs
= http://www.tldp.org = linuxdoc.org
- $man 2 nice
- $man -t xinetd > f.ps -
convert man page to ps file.
- $PAGER (usu. more or less)
- whatis (brief info)
- apropos
- whereis (shows executable
path(s) )
- which
(which dir. in $PATH first holds executable)
- --help
(but not for third party packages, which install
help files under /usr/doc)
- info (access help files beneath
/usr/info)
- man vs. info:
- hyperlinks do not exist in man pages, but exist for info
- info is more current than man
- not all man pages are maintained
- /usr/info
- www: LDP etc.
IV.
System Commands
a.
Process Management Commands
Definition of Process : -
An instance of a running program
|
- ps (`process status':
deflt: procs assoctd userid + term)
- pstree (`process status
tree' hierarchy) $pstree -a
- top (`show all processes')
- gtop (`graphical top')
- sleep (`sleep'
for a specified no. of seconds)
-
$sleep 10 &
(suspend for 10 seconds in bg)
- killall (terminate all
processes by name/runng a cmd; no pid requd)
- #killall -HUP inetd (re-reads from
/etc/inetd.conf )
- kill
- 1 = SIGHUP = HUP | 2 = INT = ^C |
3 = QUIT | 4 = ILL (illegal instr) | 6 = ABRT | 8 = FPE (floatg
pt. exceptn) | 9 = KILL = SIGKILL |
15 = TERM (default) [man 7 signal]
-
$kill -9 27645
(definitely kill process ID 27645, which can be obtained from
$ps)
- %kill 786 = %kill -15 786 = %kill -TERM 786
-
$kill -2 `pidof newmail`
(kill all processes named newmail)
- kill needs pid no.; killall needs process name
- bg (
resume suspended job in backgd after ^Z suspdd it)
- if ^Z|^C not work, $stty -a
- fg (`put job into foreground')
(eg. $fg 345)
- jobs (show running background
processes)
- $kill %3 (terminate job 3 from `jobs')
- at (execute job `at' specified
time)
-
$at 7:30 < mail.job
(
execute commands given in a text file mail.job
at 7:30; this task sends an email at 7:30 to abbas
on the machine jupiter with f.txt as message body
and specified subject)
mail.job
|
mail -s "Hi !" abbas@jupiter < f.txt
|
-
$at 11:53 < mpeg.job
(execute commands given in a text file mpeg.ftp:)
mpeg.job
|
ftp mm-ftp.cs.berkeley.edu > log
anonymous
abbas@
lcd /user2/abbas/bin/
cd pub/mpeg/play/
bin
get mpeg_play-linux-elf.tar.gz
bye
|
-
$atq
(at queue:show list of at jobs after executing at)
-
$atrm 4
(remove job in at queue)
-
$at 12:30
at> date
at> who
at> ^D
- crontab (edit `cron table';
cf. `System Maintenance' chapter)
- env (list
exported or `environment' vars only):
env.var. = a useful data item stored by the system
- $PATH=$PATH:/usr/local/bin; export PATH
(includes new directory into existing path)
- set (show
env. vars + local vars.)
- su (`substitute user')
- $su root (keep current env.vars)
- $su - xuser (inherit xuser's
env.vars., execute ~/.bashrc, ~/.profile )
- $su -c xscript (exec cmd after asking for passwd)
- wait (await process completion)
(eg. $wait 345)
- nice (`be nice':
reduce priority of a job)
- renice
(once a job is running, only renice can change its priority)
- nohup (put process in bg)
- batch
(schedule a job for later execution, but unlike at,
only when system load permits)
- watch (
monitor specified process output at regular intervals)
-
$watch date
(monitor using default period of 2 seconds, exit with
^C)
-
$watch -n 1 date
(update every 1 second)
b.
System Status Commands
(Time and Host-Related)
- hostname (display or change
`host name')
-
$hostname
(show hostname)
-
%hostname saturn
(set host name from root account)
- domainname
(display or change NIS `domain name')
-
$domainname
(show NIS domain)
- logname (show `login name')
- cal (show `calendar'
for years AD 1 - AD 9999)
-
$cal
(show calendar of current month)
-
$cal 4 1731 > dt.txt
(show calendar of April, 1731 AD pipe to file)
-
$echo $TZ
(show timezone)
- date
-
$date "+ %H:%M"
(show time. eg 18:41)
-
$date "+%D"
(show date, eg. 06/26/01)
-
#date 0101130091
(set date from root to
01/01/91, 1:00 pm)
- tty (show terminal device)
- clear (`clear' screen)
- reset (`reset' screen)
- ulimit (show+set `user limits')
-
$ulimit -a
(show all user limits)
- install
- stty (`set terminal')
-
$stty -a
(show all settings)
-
$stty kill '^C'
(kill key)
-
$stty erase ^H
(set backspace to erase;
^H is the ASCII code generated by the
<BACKSPACE> key)
-
$stty kill ^U
(kill key)
-
$stty intr ^C
(interrupt key)
-
$stty susp ^Z
(suspend key)
-
$stty sane
(restore to reasonable settings)
V.
Internetwork + Communication Tools
a.
E-Mail
- pine
(`pine is not elm', `Program for Internet News and Email')
-
^X (`exit': send a msg) | ^J (`justify', format paras) |
^T (`thesaurus' spell checker) [kamran.260]
-
~/.pinerc
(pine initialization or run-command file)
- ~/.signature
(signature file, automatically appended to
each message)
- mail
-
$mail
(view mail, use v 12 to view message no. 12)
-
$mailx
(extended mail program available on some systems)
-
$mail abbas@hotmail.com
(send mail to given address)
-
$mail -s "hello samar" abbas@samarstan < f.txt
(send mail with given subject, using f.txt as body;
useful for shell scripting)
-
~/.forward
(forward emails)
-
~/.mailrc
(mail configuration file)
- elm
- biff y|n
(be notified if mail arrives and who it is from)
- xbiff (`xbiff')
-
$xbiff -update 10 -bg black -fg yellow -geometry 50x50-0+0
-volume 80 (places mailbox icon on upper RH corner;
when mail arrives in /var/spool/mail,
beep occurs + bg becomes yellow)
- xbiff reportedly works over the network on Solaris/HPUX;
supposedly if xbiff*checkCommand: ebiff -x
exists in ~/.Xresources or ~/.Xdefaults
for Solaris 2.6 and later.
- xmh
- xmailbox
b.
Chatting
- write (`write' to logged-in
user)
-
$write ummi
whence ummi must reply
$write samar
-
$write samar tty03
(write samar on terminal tty03)
-
$write samar@venus.xly.com
(write across the internet)
- Conditions
- Login: User must be logged in.
- Permission: User must have granted talk permission:
$mesg y
.Entering
$mesg n disables all input.
- motd, news (`message of the
day' and news )
- wall (`write all': broadcast
message to all users)
-
$wall "Hello from Samar Abbas"
- Conditions
- Login: user mustbe logged in.
- Permission: user musthave granted talk permn:
$mesg y
Entering
$mesg n disables all input.
- On some sys, only root can send a wall message
usu. stored in /etc/wall
- finger
-
$finger samar
-
$finger abbas@unix.mit.edu
(finger across the internet)
- $chfn (change
your finger info)
-
~/.plan : file executed by finger
- talk
-
$talk samar@webtech.com
(talk to samar across internet)
- Conditions
- Login: User must be logged in.
- Permission: User must have granted talk permission:
$mesg y
Entering
$mesg n disables all input.
- /etc/xinetd/talk;
/etc/xinetd/ntalk: must contain
line
disable=no, else "Error on read from
talk daemon: Connection refused. Press any key...":
Default RedHat 7.0 `Custom' install has the line
disable=yes .
- kibitz, screen, advise
(spy on other terminal)
- echo (returns given msg)
-
$echo "Hello Samar"
(print to terminal)
-
$echo -e "Can you hear the Bell ? \07 "
(print to terminal, \7, \007 also work)
-
$echo -e "Enter Y or N : \c"
(remains on same line)
- crypt :
% crypt mypasswd < f.txt > f.crypted ;
% crypt mypasswd < f.crypted
- ssh (`secure shell':
encrypt whole session, telnet replacemt)
- $ssh iopb = $ssh iopb -l afsar
= $xterm -e ssh iopb abbas & .
- zircon:~$ scp abbas@iopb:~/papers/drafts/pap.html ~
= secure cp
- Procedure for auto-logins:
- $ssh-keygen : generates new keys, overwrites old ones.
Sample config (zircon 19.2.2002)
[afs@zircon afs]$ ssh-keygen
Generating public/private rsa1 key pair.
Enter file in which to save the key (/world/afs/.ssh/identity):
/world/afs/.ssh/identity already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /world/afs/.ssh/identity.
Your public key has been saved in /world/afs/.ssh/identity.pub.
The key fingerprint is:
a4:6e:98:94:2b:80:34:a1:4a:89:92:49:51:08:a1:e2 afs@zircon
- cp afs@zircon:~/.ssh/identity.pub
-->
afsar@iopb:~/.ssh/authorized_keys of server afs@iopb
- $ssh iopb -l afsar logged in without a password.
e.
www
- telnet
(remote login prog, deprecated for ssh
as unencrypted)
(hostname should exist in /etc/hosts)
- ftp
- $ftp venus.ensindia.com = $ftp 198.100.11.15
- ftp> !cmd (local shell) |
macdef xmacro (def. macro) | $xmacro (execute
macro xmacro def'd by macdef subcmd)
- ascii (default type) | bin (binary type) |
bell (sound bell after each transfer) | hash (print
hash sign # per data block of 1024b transferred) |
passive (transfer via data port; useful behind firewalls)
- netscape (`internet scape')
- lynx
(fast txt-web browser, cannot disply frames)
-
$lynx http://www.google.com
(works for direct internet connection)
-
$lynx .
(browse home dir)
-
$lynx -source http://www.ibm.com/index.html > new.html &
(download file in background)
-
$http_proxy ="http://some.server.dom:port/"
$export http_proxy
(proxy server settings,
other variables are ftp_proxy, gopher_proxy, then use
$lynx http://www.google.com
- o - options | q - quit
- links
(fast txt web browser displayg frames)
- mozilla
(excellent browser, = code base for NS)
- ctrl + | ctrl - : magnify/microfy font size
- ctrl f : find
- ctrl q : quit
- modern appearance:
Edit > Prefs > Appearance > Themes > Modern
- middle-clk opens links in tabs not new windows: check
Edit > Preferences > Navigator > Tabbed Browsing >
"Open Tabs instead of windows for Middle-click, ctrl-click or ctrl-enter on links in web pg"
- open lks in new tab in bg w/o losg current window: also check
Edit > Preferences > Navigator > Tabbed Browsing >
"Load links in the background"
- ctrl tab | ctrl pg down : cycle thro tabs
- cp paste: select, ctrl c, rbutton (cygwin) | ctrl v (win)
- ctrl h: history
- mouse wheel: Edit > Prefs > Advced > Mouse Wheel
- keywds: Edit > Prefs > Navigator > Smart Browsg
- receipts: Edit > Prefs > Mail + Newsgroups > Return Receipts
- Privacy + Security:
Cookies (cookie stoppg), Images (dont load any imgs), Popup Windows (block unrequested popup windows),
Forms (save form data), Passwords, etc.
- set as deflt browser: Edit > Prefs > Navigator > Set Deflt Browser
- keywords, eg. chicago careers,
(http://wp.netscape.com/escapes/keywords)
- RAR file support: Edit > Prefs > Navigator > Helper
Apps > Mime Type = application/x-rar-compressed &
Description = RAR File & Extension = rar, gz, tar & Open
it with: C:\Program Files\WinRAR\WinRAR.exe
(from http://www.rarsoft.com)
- Chm (compressed html) file support: Edit > Preferences
> Navigator > Helper Applications > New Type
> MIME Type: application/x-html-compressed &
Description: Compressed HTML File &
Extension: chm & Open it with C:\WINNT\hh.exe
- zip file support: Edit > Preferences
> Navigator > Helper Applications > New Type
> MIME Type: application/x-zip-compressed &
Description: Winzip File &
Extension: zip & Open it using the default application
- ctrl r: reload, ctrl shift r: force reload
- alt → | alt ← : fwd | back
- ctrl q: quit
- ctrl 6: irc chatzilla
- ctrl 5: addr book
- ctrl 2: mail + news
- ctrl b: manage bkmarks, ctrl d: add pg to bkmarks
- f11: full screen mode
- ctrl w: close tab
- w3m
(fast txt web browser)
- ncftp
(improved ftp program; includes ncftpput, ncftpget)
-
$ncftp ftp://user@mars.ensindia.com
(start ftp, which will ask for password)
-
$ncftp ftp://user:pass@mars.ensindia.com
(login without password prompt)
- Features
- Command History
- Command-Line Completion through <TAB> key
- get -R mydir (`recursively' obtain whole
dir tree under mydir using tarring) |
put -R mydir (upload whole dir tree') |
get -RT mydir (interactively obtain dir tree with
individual file comparison and without tarring) |
lmkdir mydir (`locally make dir') |
lls (`locally list')
- wget (`web get'
automatic site downloader or site sucker,
cf. ftp://ftp.gnu.org/gnu/wget)
- -r (`recursive' download of whole
site) | -b (go into `bg') |
-c (`continue' interrupted download of a large file) |
-nc (`nonclobber': do not overwrite existing files)
-
wget --header "cookie: dla=1" --post-data "action=http://download.35mb.com/user/file.txt"
http://download.35mb.com/user/file.txt -c
or Curl
curl -b "dla=1" -d "action=http://download.35mb.com/user/file.txt"
http://download.35mb.com/user/file.txt -# -o file.txt
-
$wget -r http://skyper.tmag.de/oreilly/books
(recursive mode: downloads to default of 5 levels)
-
$http_proxy ="http://198.100.11.15:8080"; export http_proxy
(proxy server settings,
other variables are ftp_proxy, gopher_proxy, then use
$wget http://www.ibm.com
-
$wget -r -nc -T 2700 --proxy=on http://skyper.tmag.de/oreilly/books
(wget in recursive, non-clobber mode ie. resume previously interrupted
downloads, with timeout in 2700 seconds and forcing acceptance of proxy settings)
-
$wget -r -l 2 -nc -T 2700 --proxy=on http://skyper.tmag.de/oreilly/books
(as above, but only to two levels)
-
$wget -q
ftp://ftp.bluebyte.com/demos/eng/extreme-assault/xa_demo.exe &
(download Extreme Assault quietly in background)
-
$wget -q ftp://3dgamers.in-span.net/pub/3dgamers/games/unrealtourn/utdemo348.exe &
(download Unreal Tournament quietly in background)
-
$wget -c -b -o iw.log
ftp://ftp.zdnet.com/gs/simulation/iwar2/iwar2demo1.zip
(continue download of 207 mb Ind.War in background)
- rftp (`remote ftp':
SOCKS proxy ftp client)
- gftp (`graphical ftp'):
$gftp or
Foot > Programs > Internet > gFTP
- xchat (IRC client)
$xchat or
Foot > Programs > Internet > X-Chat IRC Client
d.
Generic Networking
- ping (`pkt internet groper' send
ICMP (Inet Ctrl Msg Proto) ECHO_REQUEST packets to network hosts)
-
$ping 198.100.11.14
(test connection to given host)
-
$ping mars.venus.com
(ping using hostname)
- traceroute
-
$ /usr/sbin/traceroute 198.100.11.14
-
$ /usr/sbin/traceroute hotmail.com
(find route across network)
- rlogin (`remote login')
-
$ rlogin 198.100.11.14
(remote login)
-
$ rlogin -l user mars
(remote login)
-
$ rcp alpha.com:/home/f.txt f.txt
(remote copy)
VI.
X Windows
a.
Window Managers & Desktops
Definition of Window Manager : -
Controls the Look and Feel of all windows on a display, and
their arrangement.
A client which
instructs the server on the Look and Feel, the
positioning, the means of moving, and arrangement of,
windows on a
display.
|
-
twm -
( Tom's Window Manager or
Tab Window Manager
) named after its author
Tom LaStrange [Kamran].
-
fvwm -
(F(?) Virtual Window Manager)
Author Robert Nation did not specify what f was;
hence variously expanded to
feeble, fantastic, freaky, (or some other f word)
[greenfield,5.4] Versions: fvwm, fvwm2
(http://www.hpc.uh.edu/fvwm/)
-
icewm - can emulate other OS's.
-
mlvwm -
(Macintosh like vwm)
(http://www2u.biglobe.ne.jp/~y-miyata/mlvwm.html)
-
olwm, olvwm (Open Look Window Manager, Open Look
Virtual Window Manager)
Desktops by Sun.
[Kamran]
-
mwm -
(Motif Window Manager)
Licence fee = $150;
LessTif is free clone:
(http://www.lesstif.org/)
-
qvwm
(http://www.qvwm.org)
A Win95 lookalike.
Desktops include :
-
KDE
(http://www.kde.org)
A second generation desktop based on Qt toolkit.
- Gnome
(GNU Network Object Model
Environment)
(http://www.gnome.org/)
A second generation desktop.
Based on the open source Gtk+ toolkit
(http://www.gtk.org)
, unlike KDE. Its default window manager is
Enlightenment.
b.
Files & Generic Commands
- startx (`start x windows')
- switchdesk (`swith desktop')
- xsetroot (`set background')
[change bg color]
- $xsetroot -solid gray
- $xsetroot (/usr/X11R6/include/X11/cursorfont.h)
-hand1 draped_box
- xsri (change display logo); cf.
/etc/X11/xdm/Xsetup_0 for usage
- xset
- $xset m 5 10 ^nbsp;
(set mouse speed 5x faster and 10 pixels)
- xlsfonts (`text listing of all
fonts')
- xfontsel (graphical `X font selector' preview)
- xload (display system load
average)
- xmag (`x magnifier')
- xcpustate
- animate (display a series of images); eg.
$animate f*.jpg
-
~/.xinitrc (`x initialization file')
[ init file ]
-
~/.Xresources (`x resources') [ init file ]
- Default: /etc/X11/xinit/xinitrc
- /etc/inittab
(`initial table') :
id:3:... (text-mode)
should be changed to id:5... (X11 mode)
- /etc/X11/xinit/xinitrc -
global default xinit file.
- /etc/sysconfig/desktop -
Sets desktop; contains a line:
DESKTOP="GNOME"
Alternate possibilities include "KDE" and "AnotherLevel" (for fvwm2).
- /etc/X11/xdm/xdm-config
(`xdm configuration file')
- /etc/X11/xdm/Xsetup_0
(`xdm configuration file') usu. starts xsetroot, xsri.
Switching between virtual consoles is possible using
Ctrl+Alt+F1, Ctrl+Alt+F2, etc.
c.
FS Tools
- xterm (`x terminal')
- -bd (`border' color) |
-fg (`foreground' color) | -bg (`background' color) |
-fn (`font')
-
$xterm -fn `xfontsel -print` &
(font selector, using xcolorsel reported possible)
-
$xterm -g 80x24+0+0 -name "Samar Abbas"&
(new x terminal at 0,0,
80 digits wide, 24 lines high named as given)
-
$xterm -font "12x24" -fg cyan -bg black -title "My Email"
where font aliases obtained via xlsfonts list;
possibly previewed using $xfontsel or
/usr/lib/X11/fonts/misc
and colors from
/usr/lib/X11/rgb.txt
- xterm -xrm "XTerm*background: Blue"
- %xterm -e 'ssh root@saadi shutdown -h now; ssh root@rumi
reboot' (exec. multiple cmds)
- xwininfo
- rxvt
( `ouR xvt' )
(fast vt102 term emulator; faster than xterm as it uses less swap space)
- gnome-terminal :
$gnome-terminal
or Panel > Terminal Icon
- kterm
( `Kanji Terminal Emulator'): $kterm
or Foot > Programs > Utilities > KTerm
- ~/.Xresources
XTerm*font: 12x24
followed by $xrdb -merge .Xresources to inform
X server of changes (options $xrdb -load|remove|merge);
for more variables cf. $editres
clicking Commands > Get Widget Tree followed by clicking
crosshair on the desired window (eg. xterm) to display
the tree, then Command > Show Resource Box to see properties.
d.
Personal Management: Personal Info, Date and Time
- gnomecal (`gnome calendar')
$gnomecal = Foot > Programs > Applications > Calendar
- ical :
$ical or Foot > Programs > Applications > Ical
- xbiff (`mail indicator')
- xclock
-
$xclock -chime -analog -update 1
(analog clock which rings once every 30min,
twice on the h, showing a second hand updated
every sec)
-
$xclock -geometry 80x80 &
- rclock (`rclock')
- wmclock (`WindowMaker
window mgr clock')
- xdaliclock (fancy daliesque
clock)
- gfontsel
(`gnome font selector'):
$gfontsel =
Foot > Programs > Utilities > Font Selector
- gnomecard
(Address book):
$gnomecard =
Foot > Programs > Applications > Address Book
e.
Mathematical Aids
- xcalc
[ x calculator ]
-
$xcalc
- DRG: (Deg|Radian|Grad); 545 deg = 0.785
rad. | EE: exponential | ln: log(base e) |
STO: store to memory | RCL: copy from memory to display |
SUM: add display to memory | EXC: swap number on display with number in
memory | CHS: change sign | INV: invert function |
RS: roll stack downward [tackett.182]
- gcalc
(gnome calculator): $gcalc =
Foot > Programs > Utilities > Simple Calculator
f.
Display
- $DISPLAY:
- client$ xhost +|-|server | start winaxe if ms
- server$ DISPLAY=client:0.0; export DISPLAY
- WinAxe: free sw; export linux displays to ms
when WinAxe runs.
- CygWin: free Unix emulator on Windows
VII.
Multimedia
a.
Graphics
Image Viewing
- gqview
(`Gnome viewer'):
$/usr/bin/gqview file.jpg =
Foot > Programs > Graphics > GQview
- gphoto
(GNU digital camera program): $/usr/bin/gphoto
- ee
(Electric Eyes Image viewer): $ee =
Foot > Programs > Graphics > Electric Eyes
- xv (excellent img viewer)
- Screenshot: Grab: 3 sec > Dbl-clk wdw
- ghostview
(PostScript file viewer):
Foot > Programs > Graphics > Ghostview
- xdvi
(DVI - `DeVice Independent' - file viewer for
dvi files produced by tex)
- xfig
(X Figure Generator)
- xsane
(scanning software):
Foot > Programs > Graphics > XSane
Image Editing
- gimp
( `Gnome Image Manipulation Program' )
http://www.gimp.org ;
$gimp =
Foot > Programs > Graphics > The GIMP
- xpaint
$xpaint = Foot > Programs > Graphics > Paint
b.
Audio
- mpg123
(mp3 player) www.mpg123.org
- xmms
(`X Multimedia System')
xmms.org;
$/usr/bin/xmms =
Foot > Programs > Multimedia > XMMS ; $xmms
- Plugins are located in
/usr/lib/xmms/Input/; /usr/lib/xmms/Output/;
/usr/lib/xmms/Effect/; /usr/lib/xmms/Visualization/ .
- Diskwriter plugin enables writing mp3 files to disk,
as well as in .wav format, although wav format is 10x larger.
Options| Preferences > Audio IO Plugins
> Output Plugins > Diskwriter
- Installation of xmms-alsa plugin:
#cd /usr/src
#tar -xvf /home/guest/alsa/xxms-alsa-0.4.1.tar
#cd xmms-alsa-0.4.1
#./configure; make; make install;;
however, there are reportedly problems.
- gtcd
(CD player):
$/usr/bin/gtcd = $gtcd =
Foot > Programs > Multimedia > CD Player
- xplaycd
(X based audio CD player):
Foot > Programs > Multimedia > XplayCD
- playmidi
(Musical Instruments Device Interface player)
- Other mp3 players: xaudio.com, freeamp.org
c.
Video
- gtv
(`GTK+ MPEG Player'):
Foot > Programs > Multimedia > GTV Mpeg Player =
$/usr/bin/gtv = $gtv
- mplayer (best movie player)
- $mplayer -playlist myplaylist.txt
- $mplayer -gui f.avi
- aviplay (avi file player)
- xanim
- plaympeg
- mpeg_play:
ftp://mm-ftp.cs.berkeley.edu/pub/mpeg/play/mpeg_play-linux-elf.tar.gz
- cinelerra: video editg tool
d.
Games
Adventure and Text Games
- battlestar :
/usr/games/battlestar
(space adventure game)
- paranoia :
/usr/games/paranoia
(spy adventure game)
- banner :
/usr/games/banner -w 30 "Samar Abbas"
(show banner)
War Games
- doom
(`full graphical war grame'):
$doom
= /usr/games/rundoom = $xdoom
- xevil
Board Games
- xcarrom
- gnuchess
(graphical chess game for x windows): /usr/bin/xboard
- gnuchess
(character-based chess game): /usr/bin/gnuchess
Arcade Games
- xbill :
Start | Programs | Games
- xeyes :
Start | Programs | Games
Card Games
- battlestar
- Others: xevil, xdino, battlestar, trek, robots, worm, doom;
cf. /usr/x11/bin for the installed games.
- Playing CD games:
/mnt/cdrom icon should appear on desktop;
to eject, right-click > `Eject'.
VIII.
Desktops
a.
GNOME
- Setting Passwords: Control Center > Screensaver > Password
- gmenu = Programs > Settings > Menu Editor
to edit Foot menus.
b.
KDE
- Setting Passwords:
KDE Control Centre > Look and Feel > Screensavers > Setup
| Settings > Require password
c.
Office Apps
Doc. Processg
- oodraw
- Pie Charts:
- File > New Drawing to ensure new drawg
- Insert > Chart ; Format > Chart Type : 2D: Pie Chart
- Edit > Chart Data = rclick > Chart Data
- rclick > Title/Edit > Chars : set title font
- oocalc ;
ooffice
- Star Office: (Sun Microsys' office suite)
%soffice =
[installdir]/Office51/bin/soffice,
eg: /usr/local/Office51/bin/soffice
or /usr/local/office52/soffice
- abiword
( MS Word clone; handles MSWord, rtf ) Download:-
http://www.abisource.com/free.phtml
References
- [ce.lpi] = certifyexpress.com LPI exam notes.
- [stocker] = `Removing Blank Lines from a File'
by Sandra Henry-Stocker, ITWorld, 06/27/2001
http://www.itworld.com/nl/unix_sys_adm/06272001/
- [kamran] = `Linux Unleashed', by Kamran Hussain, Tim Parker,
etal., Sams
Publishing, Indianapolis
1995.
- [lpi] = LPI Linux Exam
- [rh033] = Red Hat 033 Guide
- [rute] = `Rute User's Tutorial and Exposition';
rute.sourceforge.net
- [tackett] = `Using Linux', by J.Tackett, D.Gunter and L.Brown,
Que Corp. 1995, Indianapolis.
- [welsh] = `Running Linux', Matt Welsh, Lar Kaufman,
O'Reilly Publishers.
- [greenfield] =
`The Linux Users' Guide', Larry Greenfield 1996.
- [xwinman] = X Window Managers Website (http://xwinman.org/)
- [metalab] = Metalab archive X Window Managers
(ftp://metalab.unc.edu/pub/Linux/X11/window-managers/)
- [man] = http://www.linuxcentral.com/linux/man%2Dpages/
- [sol.man] = http://solarisguide.com/rtfm.php
- [unix-faq] =
http://www.faqs.org/faqs/unix-faq/
Browser Wars
- NS 7 shrivels under Mozilla's Shadow
http://www.eweek.com/article2/0,3959,493248,00.asp
- mozilla shortcuts
http://www.mozilla.org/docs/end-user/moz_shortcuts.html
- Unix CD Bookshelf (full ebooks)
http://rtfm.rdadolf.no-ip.com/Books/oreilly/unix-bookshelf/