-
- Weitere Informationen zu diesem Buch:
Inhaltsverzeichnis | Index | Probekapitel | Kolophon | Rezensionen |
Beispiele |
- Weitere Informationen zu diesem Buch:
Third Edition Oktober 2002
ISBN 978-0-596-00330-2
Weitere Informationen zu diesem Buch
Inhaltsverzeichnis |
Index |
Probekapitel |
Kolophon |
Rezensionen |
Beispiele |
Index
[ Symbols ], [ Numbers ], [ A ], [ B ], [ C ], [ D ], [ E ], [ F ], [ G ], [ H ], [ I ], [ J ], [ K ], [ L ], [ M ], [ N ], [ O ], [ P ], [ Q ], [ R ], [ S ], [ T ], [ U ], [ V ], [ W ], [ X ], [ Y ], [ Z ]
Symbols[ Top ]
< > (angle brackets)
<
<< (here document) operator, 534, 560
< (less than) operator, 385, 762, 846
<= (less than or equal to) operator, 385, 762, 847
<<- operator, removing tab characters, 535
<<- operator, removing TABs with, 560
< redirection character, 888
>
> as Bourne shell secondary prompt, 556
> (greater than) operator, 762, 846
>= (greater than or equal to) operator, 385, 762, 847
> (redirection) operator, 891
>& (redirection) operator, 891
> tcsh shell prompt, 11
>> (Unix redirect and append) operator, 317
< >, enclosing event names, 132
\< \> regular expression metacharacters, 643, 652
<=> (comparison) operator in Perl, 847
<-> filename wildcard, 659
{ } (braces)
\{ \} regular expression metacharacters, 642, 651
awk procedures, enclosing, 381
dereferencing, use in, 852
filename wildcards, 659
find command, 180, 187
GNU find command and, 181
in shells, 20, 661
pattern-expansion characters
building strings with, 545-547
for loop, using with, 557
foreach loop, using with, 555
quoting alias argument in, 574
sed commands enclosed in, 694
shell functions, using in, 582
variable values, interpolating, 704
[ ] (brackets)
[^ ] filename wildcard, 659
[ command, 735
numeric tests, syntax errors, 777
string text syntax errors, 778
bash shell prompts, nonprinting characters, 80
range operator, 405
references to lists in Perl, 852
regular expression metacharacters, 651
^ (caret) within, 641
character classes, 855
range, specifying, 640
wildcards, 544, 658
fast find commands, using with, 189
( ) (parentheses)
\(\)
escaped-parenthesis operators in sed, 678, 768
find command operator, 172
regular expression metacharacters, 644, 651
commands printed in by ps, 462
grouping operator, 251
combining commands with, 893
extended regular expressions, 645
Perl regular expressions, 855
use in Unix programs, 652
nesting regular expressions in, 250
operator precedence, overriding with, 635
Perl operators, resolving ambiguity in, 848
subshell operator, 45, 895
& (ampersand)
&! background operator, Z shell, 446
&| background operator, Z shell, 446
&& (Boolean AND) operator, 216, 381, 564, 605, 718, 842, 847
& (logical AND) operator, 763
commands ending with, 436, 438, 454
metacharacter in regular expressions, 677
* (asterisk)
** filename wildcard (zsh), 659
*** filename wildcard (zsh), 659
arithmetic operator (multiplication), 762
executable files, denoting in ls -F listings, 164
filename wildcard, 658, 659
multiplication operator, 846
regular expression metacharacter, 636, 637
quantifier in Perl, 855
repeating character sets with, 641
use in Unix programs, 651
shell metacharacter, 636
wildcard character, 19, 189
@ (at sign)
@ARGV array, 844
csh built-in operator, 545
filename wildcard, 659
files as symbolic links, in ls -F listings, 164
for array names, 848
in Perl array values, 844
@INC array, 841, 844
kill character, 106
` (backquotes)
\` \`, nested command substitution, 769
arguments, reading, 565
capturing command output in an array, 855
command substitution operators, 96, 170, 561
excluding files from deletion, 275
getopt, using with, 731
nesting, 562
command substitution with, 174
expr command, running with, 764
for loops combined with, 750
quoting in Bourne shell, 528
redirecting standard output, 756
\ (backslash)
\(\)
regular expression metacharacters, 644
\{ \} regular expression metacharacters, 642, 651
\! operator (C shell), 572, 575
\(\) regular expression metacharacters, 651
\1, \2, ... metacharacters, recalling remembered patterns, 644
escaping regular expression delimiters in sed, 676
escaping regular expression metacharacters, 638
extended regular expressions and, 646
in X Window System resource definitions, 130
multiline pipes in C shell scripts, 725
multiple-line statements in Python, 871
Perl variables, preventing interpolation in, 845
quoting newlines in sed, 697
regular expression metacharacters
\< \>, matching words with, 643
use in Unix programs, 651
shell, terminal and program quoting, conflicts in, 540
\ (backspace), stripping from formatted manpages, 35
^ (caret)
[^ ] filename wildcard, 659
^[ (ESC character), 158
^^ sequence in history substitution, 596
beginning of line anchor in regular expressions, 637, 638
beginning of line indicator in various utilities, 639
filename wildcard, 659
in control keys, 105
regular expression metacharacter
matching at beginning of line (Perl), 854
matching newline at the beginning of a multiline pattern space, 685
negating character classes with, 650
use in Unix programs, 651
within [ ] metacharacters, 641
^xy^yx, shorthand substitution command, 602
: (colon)
between item=attribute values, 159
Bourne shell operator, 746
parameter substitution, use in, 747
command in vi, 309, 335
in command-line options, 731
ex commands, issuing from vi, 370
logical operator, 763
as null character, 717
:p operator, printing command without executing it, 605
separating fields, 11, 101
separating terminal type values, 96
shell script comments, 742
string editing operators, 547-549
translation table, event and action mappings, 132
, (comma) in filenames, 17
- (dash)
-> (dereferencing) operator, 844, 852
- numerical subtraction operator, 846
command-line arguments starting with, 728, 729, 731
double dashes, converting to em-dashes in sed, 693
filenames starting with, 271
subtraction arithmetic operator, 762
with << operator, 535
$ (dollar sign)
$( ) command substitution operator, 563, 769
$* argument, 765, 779
$@ argument, 725, 726, 765, 779
passing arguments to getopt, 731
replacement by arguments passed to function, 581
$# command-line argument, 726
$- variable, displaying current flags, 49
$_ variables in Perl, 848, 853
$0 parameter, script names in, 737
$1, $2, etc., command-line arguments in, 583
$1 command-line arguments, 720, 725
in bash shell prompt, 11, 72
inside double quotes in C shell quoting, 532
end of line anchor in regular expressions, 638
end of line indicator in various utilities, 165, 639
$Id $ in RCS files, 815
metacharacter in regular expressions and shells, 536
quoting in Bourne shell, 528
regular expression metacharacter
matching at end of line (Perl), 854
matching newline at the end of multiline pattern space, 685
use in Unix programs, 651
sed addressing symbol, 673
value of Bourne shell exit status variable (?), getting, 715
variable names, preceding, 704, 713, 844
as wildcard, 714
. (dot)
. and .. in directories, 202, 207
. and .. in pathnames, 24
. command, reading files with, 737
./ (dot slash), filenames beginning with, 271
.. (integer-range) operator in zsh, 546
. (string concatenation) operator, 846
in filenames, 16, 19
filenames beginning with, 273
ls command and, 163
wildcards and, 660
regular expression metacharacter, 636
matching any character (except newline) in Perl, 854
matching any character with, 640
use in Unix programs, 651
relative pathname for current directory, 620
repeat command in vi editor, 313
= (equal sign)
=> (fat comma) operator in Perl, 850
== (numeric equality) operator, 846
=~ (pattern binding) operator, 854
== (relational) operator, 385
in alias definitions, 575, 576
assignment operator, 844
relational operator, 762, 763
socket files, 164
! (exclamation point)
[! ] filename wildcards, 658
! (Boolean NOT) operator, 381
! (logical negation) operator, 172, 847
with find command, 179
!= (not equal) operator, 385, 762, 846
!~ (pattern-matching) operator, 385
!$, specifying last argument on previous line, 639
in C shell quoting, 532
command line exit status, reversing in bash and zsh, 716
filename wildcard, 659
filtering vi text through Unix command, 322
find command operator, 249
history substitution commands, 599
!! and !: sequences, 599
!$ notation, 572
!* notation, 572
!$ sequence, 595, 597, 601
!* sequence, 601
!^ sequence, 601
bash shell quoting and, 527
!:n* sequence, 595
regular expression metacharacter
sed editor replacements, 693
sed address followed by, 672
test command using, 735
in X Window System comments, 130
# (hash mark)
# and ## filename wildcards, 660
: (colon) used in place of, 746
#! notation, 516, 743
in Bourne shell scripts, 698
in Perl scripts, 843
in comments, 742
# $Id $, commenting RCS files in a shell or Perl script, 815
dynamic prompts in tcsh and zsh shells, 72
erase character, 106
in crontab entries, 491
shell prompt for zsh shells, 528
vi editor, alternate filename, 310
% (percent sign)
%?, prefixing job numbers, 440
arithmetic operator (modulus), 762
formatting operator in Python, 875
in shell prompts
%{ and %} delimiters for nonprinting escape sequences, 80
%# (dynamic prompt), tcsh and zsh shells, 72
%! for zsh hisotry number, 72
C (csh) shell, 11
vi editor, current filename, 310
+ (plus sign)
++ (autoincrement) operator, 846
+ operator (one or more), 250
addition (arithmetic) operator, 635, 762, 846
data command option, 170
filename wildcard, 659
in job numbers, 439
regular expression metacharacter, 250, 645, 652
quantifier in Perl, 855
? (question mark)
?) wildcard metacharacters in case statements, 714
?*) wildcard metacharacters in case statements, 714
Bourne shell variable for command exit status, 715
filename wildcard, 658, 659
nonprinting characters, converting to with ls -q, 166
regular expression metacharacter, 250, 645
quantifier in Perl, 855
use in Unix programs, 652
as secondary shell prompt, 555
shell wildcard, matching with fast find commands, 189
wildcard character, 19
" (quotes, double)
$ and ' inside, in C shell quoting, 532
around filenames, renaming files and, 212
converting straight quotes to curly quotes with sed, 693
for comments in vi .exrc file, 335
in command arguments, 8
in prompts, 71, 75, 76, 80
in regular expressions, 250
in sed scripts, 783
in shell quoting, 527, 528, 531
ls -Q command output, 165
passing wildcards to programs, 661
search patterns in csplit program, 403
shell arrays, expanded values, 196
variable interpolation in Perl, 845
wildcard pattern matching in case statements, 714
' (quotes, single)
; (semicolon), using with in C shell, 180
around filenames, renaming files and, 212
in alias quoting, 573, 575
in bash pre-prompt commands, 88
in prompts, 71, 76, 80
in shell quoting, 527, 528, 531
inside double quotes (C shell), 532
passing wildcards to programs, 661
regular expressions, quoting, 634
strings in case statements, 714
; (semicolon)
code separator in color escape sequences, 158
separating awk procedures, 381
separating commands, 563, 722
in case statements, 714
find -exec and, 180
in shell functions, 581
/ (slash)
/* $Id $ */, commenting C program RCS files, 815
/*/* wildcard metacharacters in case statements, 714
arithmetic operator (division), 762
arithmetic opertor (division), 846
Bourne-type shells, quoting and, 527
delimiter for regular expressions in sed, 675
directory, denoting in ls -F listings, 164
in filenames, 16, 19
in pathnames, 24, 619
wildcard matching across, 801
absolute pathnames, 13
tar archives and, 796
search patterns in vi editor, delimiting, 314
shell, treatment of, 189
~ (tilde)
~ and !~ (pattern-matching) operators, 385
abbreviation for any directory, 575
filenames ending with, 629
Emacs backup files, 17, 161
for home directory, 51, 629, 148
in pathnames, 24
_ (underscore)
ASCII class for, 110
in filenames, 16
| (vertical bar)
|| (Boolean OR) operator, 381, 564, 717, 847
testing scripts with, 718
|& operator, 891
alternation operator, 250, 251, 854
bitwise or operator, 844
command separator in ex editor, 320
filename wildcard, 659
files, named pipe (FIFO), 164
logical OR operator, 763
noclobber variable and, 892
pipes, 9
redirecting standard output, 756, 757
regular expression metacharacter
alternation in pattern matching, 645
use in Unix programs, 652
separating multiple ex editor commands, 344
wildcard metacharacter in case statements, 714
Symbols[ Top ]
\ (backslash)
in alias quoting, 573
before newline, shell quoting and, 530, 532
in prompt settings, 87
in shell quoting, 527
Bourne shell, 528
C shell, 531
Numbers[ Top ]
:0 (zero) operator, in history substitutions, 600
0 (zero) process ID, 474
-1 process ID, 474
A[ Top ]
abbreviations for words, vi editor, 328-331
commands, using as, 330
.exrc files, saving in, 312
fixing typos with, 330
abbreviations in pathnames, 24
absolute pathnames, 13, 618
archiving with, 813
creating, 619
to directory containing new search path, 519
Emacs and, 363
links to, 210, 212
in shell setup files, 51
tar, avoiding with, 803
access control
files (see permissions)
firewalls, using, 949
host-based, rsh command and, 143
incoming connections, with tcp_wrappers, 942
remote access (see ssh)
Samba, 953, 956
sshd program, 943
user-based, xauth command and, 143
access method for software package files, choosing, 826-828
access modes for files, 263
private directory, 150
setting for files with find, 183
supplying with mkdir command, 153
(see also permissions)
access times for files, 155
-atime operator with find, 177
locating files by, 274
last-access time, showing, 156
accidental file deletion, protecting against, 265
accounting name for commands, 462
accounts
protecting, 969
setup, changing, 50
(see also groups; users)
addresses
IP, 937
displayed with netstart -n, 940
displaying with dig, 941
hostname mapping to, 945
NAT (Network Address Translation), 948, 950
sed editor, 672-674
TCP and UDP, 937
addressing lines for batch editing, 369
adduser (or useradd) utility, 984
Adobe Acrobat Reader and PDF, 930
Advanced Maryland Automatic Network Disk Archiver (Amanda), 806
afio utility, 795
age of files, 168
agents
-agent option, ssh, 799
compromised machines in DDoS attacks, 973
SSH, problems with, 1019-1021
agrep command (approximate grep), 247, 251
compound searches with, 256, 257
-d option, 252
multiple patterns with AND (or OR) queries, 252
AIX
OpenSSH, 1012
ps command, 459
alias command, 572
Bourne-type shells, 574
-d (directory) option, 575
-g (global) option in zsh shell, 576
-m (match) option, 576
-t (tracked) option, 575
aliases, 13, 571-581
!* sequence in, 601
Bourne-type shells, 574
removing, 575
C shell, 46, 50
if-then-else in, 579
with command-line arguments, 572-574
for cd command, 627, 77
changing to shell functions, 581
clean, removing stale files with, 275
for constant-width fonts, 112
defined on command lines, 571
file-deletion, 266
findpt, 249
group-write permissions, 997
inside the ($?prompt) test, 53
kill command and, 475
Korn shell, 575
limitations of, 576
lr, listing recently changed files, 162
ls command, 163
newer (printing newest filename), 169
permission changes, handling with, 1002
precmd (tcsh shell), 87
prompt set inside, 76
for pushd command, 626
quoting, 572-574, 580
fixing in csh with makealias and quote, 580
reading logout file when using exit command, 52
recursive, 578
redefining commands, problems with, 579
setprompt, 85
shell functions and, 581
simulating in Bourne shell, 591
sourceable scripts, options for, 578
tracked, 520
wildcards in, 520
word vectors and, 524
zsh, 576
alphabetic sorting vs. numeric, 426
ALT key in Emacs, 354
alternation in regular expression pattern matching, 645, 854
alternation operator (|), 250, 251
Amanda (Advanced Maryland Automatic Network Disk Archiver), 806
anacron system, 489
anchors (in regular expressions), 637
^ and $ anchor characters, 638
anchor characters, examples of, 639
and (-a) operator, case command, 770
AND operator, 177
&& (Boolean) AND, 381, 564, 605
& (logical AND) operator, 763
agrep command, searching for multiple patterns, 252
and operator (Boolean), 847
Ange-ftp mode (Emacs), 357
anonymous FTP, 534
server, configuring, 944
anonymous functions (Python), 872
Apache webserver, module for running Python, 876, 879
append command (ex), 370
applications
default files for resources, 139
names of, resources and, 135
relationship with kernel, shell, and utilities, 8
running remotely and viewing on local display, 140
appres (application resource) utility, 139
approximate patterns, searching for (see agrep command)
apsfilter script, 932
apt-get tool, 832-834
archives, 808-821
Amanda system, 806
copying without asking for password, 799
CPAN (Comprehensive Perl Archive Network), 841
cpio tape archiver, 805
deleted files on tape, 274
filename extensions, 17
packing up and moving files, 808
shell, 18
tar (see tar utility)
version control systems, 814
CVS, 818-821
RCS, 815-818
arguments
executing as commands (xarg command), 174
filenames in, 533
finding last, 749
iterating shell variables over, 779
maximum allowable, 566
passed to scripts, 12
passing lists to other programs with $@, 780
Python functions, 872
lambdas as, 873
reading by shells, 526
separators for, 527, 532
C shell quoting and, 533
inside backquotes, 562
showargs script, 518
stored in $1, $2, etc., 583
too many, dealing with, 565-567
(see also command line; commands)
"arguments too long" error message, 174
@ARGV array (Perl), 844
argv, variables set to, 779
arithmetic (built-in) for shells, 584
arithmetic operators, 762
array indexes, Perl, 411
arrays
awk utility and, 383
Perl, 844, 845, 848
iterating through, 849
lists vs., 849
operators used with, 849
shell
browsing directories with, 194-197
expanding ranges, 196
arrow keys
cursor motion in vi text-input mode without using, 349
Emacs editor, moving around in, 354
mapping in vi, 339
ASCII
converting to EBCDIC with dd, 410
encoding binary files into, 406-410
MIME encoding, 408-410
uuencoding, 407
end-of-line characters, 11
filename extension, 18
"printable" representation of unprintable and non-ASCII characters, 237
xterm table of characters and character classes, 110
zeros (NUL characters), 899
(see also non-ASCII characters)
ash shell, 10, 513
aspell utility, 297
-a option, 298
Assembly language code extension, 17
assignment operator (=), 844
associative arrays, 167
awk utility, 383
(see also hashes)
at commands, 489, 495-498
atq command, 496, 497
atrm command, removing jobs in queue, 496
-l option, 497
limiting file size, 281
quieting output, 496
-r option, 497
AT environment variable, 54
atan2 command (awk), 383
-atime operator (find command), 178
atomic operation, testing for and creating lockfile, 772
attribute code (bold, underscore, etc.), 159
Audio::SoundFile module, 842
authentication
PAM (Pluggable Authentication Modules), 1015
with SMB server, 955
SSH, 1012
problems with, 1013-1019
autoconf utility, 825
autoincrement (++) operator, 846
autoloading shell functions, 587
Korn shells, 589
automake utility, 825
automated deletion commands, risks of, 274
automatic directory setup, 630
automating /bin/passwd, 568-570
auto-save file (Emacs), 358
autowrite (vi), job control and, 442
awk utility, 367, 378-389
arrays and, 383
associative arrays, 167
centering lines, 397
command-line syntax, 379
counting files by types, 167
echo command, using with, 765
eval compared to, 724
extended regular expressions, use of, 637, 645
-f option, 744
grep programs, 248
lexical analyzer, 306
line-by-line and search using, 256
line-numbering with, 246
operators, 382
patterns, 380
procedures, 381
regular expressions, documentation for, 653
running directly, 743
searching for a character in a column, 258
sorting lines by length, 429
straightening columns, 415
variables, 382, 383
wrappeing awk programs in shell scripts, 724
B[ Top ]
b (branch) command, sed editor, 693, 694
background color, 159
background jobs, 454
bringing into foreground with fg command, 438
killing, 436
listing with their job numbers, 436
notification of state change in, 444
putting into foreground, 436
suspending with stop command, 436
background processes, 14-16, 435, 454
exit status
testing with if statement, 716
exit status of, 715
listing with jobs command, 438
output from, stopping, 444
overloading system with, 441
preventing continuation after logout, 473
running at lower priority with nice command, 441
shell capabilities for manipulating, 438
stopping automatically upon attempt to write to screen, 436
watching, 498
backquotes (see `, under Symbols)
BACKSPACE key, 105
Emacs editor, 354
erase character, 783
location for, 60
backup files
bkedit script, 717
Emacs, 17, 358
ignoring with ls -B, 161
file ownership and, 999
ispell program, 297
macro for creation in vi editor, 351
-backup option (xrdb), 138
backups, 787-807
compression, advantages and disadvantages of, 794
cpio tape archiver, 805
excluding files from, 799
GNU tar, using with remote tape drive, 798
incremental, 798-800
industrial strength, 806
making to a local device, 790-795
deciding what to back up, 791
floppies or zip disks, 794
tape, 792
making your own, 788
protecting against accidental file deletions, 265
RCS and CVS, 814
to remote tape drive using tar, 797
restoring files from tape with tar, 795
remote restoring, 797
restoring a few files, 796
tar utility, 788
absolute pathnames, avoiding, 803
avoiding absolute pathnames, 803
options for, 790
tar command line arguments, order of, 804
wildcards, using, 800-803
utilities for, 795
versions control systems, using, 790
barewords used as hash keys, 850
base64 encoding, 408
basename program, 751
bugs in, 752
examples, 748
loops, using with, 752
bash (Bourne-again shell), 10, 513
{ } (pattern-expansion characters), 545
aliases, 571, 574
arrays
browsing directories with, 195
expanding ranges, 196
bash2, built-in kill command, 475
BASH_ENV variable, 706
.bashrc file, 47
.bashrc or .bash_profile, hung terminals and, 101
case statements, 54
choosing built-in, external, or shell functions, 523
command history (see history of commands)
command-line editing, 614
completion features, 549
hostnames, 551
disown command, 446
dynamic prompts, simulating, 72
editing history substitutions, 547
environment variables for shell functions, changing, 586
environment variables, unsetting, 704
exit status of command line, reversing, 716
exporting shell functions, 586
fc -l command, listing previous commands with, 598
forcing to use internal exit command, 52
globbing (wildcard expansion), preventing, 660
hash command, 520
history file, 606
history -r command, cautions about, 598
ignoreeof variable, 90
job control commands, 436
limiting file size, 280
loading changed PATH, 519
login and nonlogin, startup files, 48
logout file, running commands when logging out, 89
octal character strings, 80
parameter expansion shortcuts, 780
passing command history to, 608
pre-prompt commands, 87, 88
process substitution, 542
prompts, 71
$ in, 11
newline (\n) character in, 77
nonprinting escape characters, 80
showing directory stack, 85
subshell level, showing, 83
read-only functions, 585
redirecting standard I/O, 887
scripts in this book, 516
SHLVL environment variable, 82
showargs script, 518
special characters/operators, 536-539
string editing operators, 748
stty tostop command, background jobs writing to terminal, 445
terminal port type, putting into ttykind shell variable, 58
ulimit -c command, removing limits on core dumps, 281
wildcards, failing to match, 662
(see also bsh; shell scripts; shells)
BASH_ENV environment variable, 706
.bash_login file, 47
.bash_profile file, 47
CDPATH variable, 623
.bashrc file
CDPATH variable, 623
logout file, making all top-level interactive shells read, 52
batch editing, 367-389
awk utility, 378-389
command-line syntax, 379
operators, 382
patterns and procedures, 380
system variables, 382
changing many files by editing one, 373-375
ed editor
example, 375
failure on big files, 376
ex editor
example, 375
useful commands, 370-372
line addressing, 369
patch program, 377
running scripts in vi, 373
scripts, writing, 368
BEGIN and END patterns, awk, 380
behead script, 395, 409
Bell Labs research operating system (Plan 9), 10
Berkeley Internet Name Daemon (bind), 946
DNS cache, setting up local, 947
Berkeley-based Unix
ex, vi, view, edit commands, linked to same executable file, 748
group file ownership, 998
printing commands, 915
tr command, ranges in, 405
bg command, 436, 438
putting jobs in background, 102
bgnice option (ksh), 482
bg_nice option (zsh), 482
/bin directory, 149, 822, 823
/bin/passwd, automating, 568-570
/bin/time utility, 503
programs in, 13
remote shell (rsh), 143
binary characters, inserting into Emacs files, 363
binary files
accessible by users in /usr/bin subdirectory, 822
archiving system test file, 803
encoding into ASCII, 406-410
MIME encoding, 408-410
uuencoding, 407
executables, access time updates, 274
searching for words in, 259
system, in /sbin directory, 823
bind (Berkeley Internet Name Daemon), 946
DNS cache, setting up, 947
bind command, 613
-l option, 614
binding operator (=~), 854
bindkey command
-c option, 613
-k option, 612
-l option, 612
tcsh editing, 611-613
-v option, 615
bit bucket, 279
bitmaps, 934
bitwise or (|) operator, 844
bkedit script, 717
ending and setting exit status, 720
parameter substitution in, 747
blank lines, squashing extras, 241
blank shell prompts, 83
blocks
of bytes, counting with tail -b command, 243
of code, defining in Python, 871
of text, defining with patterns, 317
of related options in smb.conf files, 952
body of email, forming properly, 410
bold text, 116, 158
Boolean operators, 847
combining awk patterns with, 381
/boot directory, 823
boot -v command, 901
boundary-checking versions of C functions, 972
Bourne shells, 10, 513
newlines in prompts, 77
profile file, 45
scripts in this book, running on, 516
types of, 515
(see also bash; ksh; sh; zsh)
branch (b) command, sed editor, 693, 694
break command, 623, 730
awk, 384
broken links, 208
browseable option (smb.conf), 953
browsers
closing window by killing its processes, 485
for Samba, 957
SMB network, 956
text copied from, reformatting, 121
BSD Unix
file ownership, 1009
Filesystem Hierarchy Standard, support of, 823
group membership, 987
make utility, versions of, 824
nice command, 507, 508
C shell, 508
ps -a command, 461
ps -aux command, 457
ps -ax command, 462
renice command, 507, 510
signals, 468
user/group infrastructure, 982
bsplit utility, 399
buffer overflow, security vulnerability, 972
buffers
edited, saving as files in vi, 316
hold space in sed, 680-683
numbered, recovering vi editor deletions in, 313
pattern space in sed, 680
pipes, buffering of output, 894
recovered with vi -r, cautions about, 325
vi editor, using to copy and move text, 313
buildhash script, 302
built-in commands, 523
builtin command, forcing use with, 523
C shell, determining whether to use, 524
faster prompt setting with, 74
shells, 13
bunzip2 file decompression program, 283
button presses
defining with xmodmap, 124-127
byte order, converting with dd, 410
bzip2 utility, 283, 790, 794
C[ Top ]
c function (for changing directories), 627
C language
C mode for programming in Emacs, 356
csh shell, 9, 10
interoperability of programs on different Unix systems, 6
lexical analyzer for syntax checking, 306
program file extensions, 17, 18
tcsh shell, 10
C shell (csh), 453, 513, 515
{ } (pattern-expansion characters), building strings with, 545
{ and } and ; (with find command), 180
!^ and !$, specifying first and last arguments on previous line, 639
aliases, 571
if-then-else in, 579
with command-line arguments, 572-574
arrays, 195
expanding ranges, 196
avoiding alias loops, 578
background processing, 438
built-in string operators, 74
choosing among built-in commands, external commands, or shell functions, 524
command history (see history of commands)
configuration files, 51
aliases, 50
csh command name, 103
.cshrc file, 46
current directory, updating in status line, 77
defining variables, 712
editing history and variable substitutions, 547-549
environment variables, unsetting, 704
eval command, 96
exit status of previous command, 715
forcing to use internal exit command, 53
foreach loop, 554
globbing (wildcard expansion), 660
:gt operator, 85
history characters, 615
history file, 607
history (see history of commands)
ignoreeof shell variable, 90
limiting file size, 280
.login file
TERM variable, testing, 55
.logout file, 89
multiline commands, 559
passing command history to, 608
port, testing, 57
prompt
% in, 11
problems caused by, 73
setting, 71
quotation marks around filenames, 212
quoting in, 531-534
here documents, 534
rules for, 532-533
showing with verbose and echo settings, 533
special characters, 531
special characters in filenames, 533
redirecting standard I/O, 887, 891
noclobber variable, 892
rehash command, 150, 520
repeating commands with repeat command, 554
script file extension, 18
search path for commands, changing, 519
sed newlines quoting and backslashes in shell script, 697
set echo verbose command, 101
special characters/operators in, 536-539
su -f stucklogin command, 100
(see also shell scripts; shells; tcsh shell)
cable modems
DHCP and, 948
firewalls, 950
gateways, 948
cache, DNS, 946
cancel command (System V), 917
canonical hostname, 941
capitalization (see case)
CAPS LOCK key, 125, 348
capturing in patterns, 855
carriage returns
Macintosh, ASCII character for, 11
translating to newlines, 406
case
case sensitivity, 16
case-insensitive searches, faking, 258
case-insensitive sorts, 428
case-sensitivity
in regular expressions, 635
converting to/from uppercase or lowercase
awk utility, 388
dd utility, 410
filtering vi text through tr command, 323
sed transform command, 683
(see also tr command)
ispell program and, 297
:l operator, 549
lc operator, 846
sort command, sort order, 426
:u operator, 549
uc operator, 846
uppercase letters in vi character and line commands, 332
uppercase without CAPS LOCK in vi, 348
vi and ex editors, capitalizing words, 320
case statements, 54
adding to .profile to test TERM variable, 56
debugging, 776
port, testing, 57
testing exit status for commands, 717
testing pathnames for calling a script, 748
testing tty name, 75
testing two strings using, 770
in while loop, handling arguments with, 728
wildcard pattern matching, 714
in xmessage command line, 772
cat command, 7, 234
creating mail header with, 409
-e option, marking ends of lines with $, 165
exit status, testing, 718
file, adding to end of another file, 517
for loops combined with, 750
-n option, 246
redirecting I/O, 888
-s option, squashing extra blank lines, 241
starting pipelines, 888
-t and -e options, displaying whitespace, 238
-v -e options, 639
-v option, 158, 237
-v -t and -e options, displaying whitespace, 239
CBLKWID (comment block width) environment variable, 394
cd command, 13, 77, 620
aliases for, 627
cdpath variable and, 622
+n and -n options (zsh), 626
PWD environment variable and, 706
cdable_vars shell variable, 630
CDPATH environment variable, 622
cdpath shell variable, 622
CD-ROMs, 900
cdrom protocol, 832
loopback mounts, 907
mounting, 905, 906
centering lines, script for, 397
CERT
intruder detection checklist, 977
safely setting up anonymous FTP, guide for, 944
security checklists, 970
security vulnerabilities, information about, 971
CGI scripts, Python module for, 876, 878
cgrep script, 255, 690-692
chain of processes to a window, 480-482
change command (ex), 370
change times for files, 154
inode information, 156
find -ctime, accessing with, 176
character classes
for ASCII characters, 110
defining in Perl regular expressions, 855
character commands in vi, 331
character sets (in regular expressions), 637
exceptions to, indicating with [^ ], 641
matching a character with, 639
repeating with *, 641
character strings (see strings)
characters
converting with tr command, 11
counting with tail -c command, 243
counting with wc command, 303, 304
deleting from a file with dd, 396
deleting in Emacs, 354
nonprintable
displaying with od -c command, 239
nonprinting
showing with cat -v or od -c, 237-239
(see also special characters)
ranges of, specifying for regular expressions, 640
special (see special characters)
translating with tr command, 404-406
charClass resource (xterm), 111
checkout command (co) in RCS, 815
checkout, CVS repository, 818
checksed script, 671
chess script, 570
chgrp command, 26
child processes, 454
changes to environment of, 455
environment variables, inheritance of, 703
exit status returned to parent, 455
file descriptors given to, 755
killing parent of, 471
relationship to parent, 454
signals and, 470
child signal, 468
CHLD (child) signal, 468
chmod command, 12, 699, 1000
= operator, 1001
adding and subtracting permissions, 1001
go+rx bin to give other users access to bin directory, 150
go-w bin, write access to bin directory, 150
numeric mode, 1000
permissions, changing, 996
-R option, 1002
changing permissions for directory tree, 1001
symbolic modes, 1000
chmod function (Perl), 856
chopping columns out of a file, 34
chown command, 1010
chown function (Perl), 856
Christiansen, Tom, 888
chroot, anonymous FTP connections, 944
ci (checkin) command (RCS), 815
Citrix, 963
Metaframe, 963, 964
class methods (Python), 873
class of objects, application resources associated with, 128
class variables (Python), 873
classes (Python), 873
clean alias, removing stale files with, 275
cleanup script, 276
clear command, 89
clear text SMB passwords, 955
CLICOLOR environment variable, 161
clients
ICA, 964
Python as web client, 876
RDP, for Unix (rdesktop), 965
RDP, HOBLink JWT, 966
remote, starting for X window systems, 140-143
from interactive logins, 141
with rsh and ssh, 142
SSH, problems with, 1021-1029
Unix VNC, connecting to Windows server, 961
VNC (Virtual Network Computing), 959
CLIPBOARD selection (xterm), 117
clock in Unix, 781
close( ) method (for Perl objects), 844
close command (awk), 384
closing windows
by exiting the shell, 482
by killing window processes, 484-487
cmd field in crontab entries, 490
cmp operator (Perl), 846
cmp program, 226
co (checkout) command (RCS), 815
-j option, merging file versions with, 817
-p option, sending file to standard output, 816
Collinson, Peter, 724
color
displaying names of with ls command, 158-161
in shell prompts, 79
LS_COLORS environment variable, 159, 707
columns
chopping out of a file, 34
column utility, creating with, 413
rebalancing into table with variable-width columns, 414
cutting, 410
ls -C command, listing output in, 157, 165
pasting data into, 416
searching files for character in, 258
straightening, 415
text in, with pr command, 411-413
COLUMNS environment variable, 59
comma (,) in filenames, 17
comma, "fat comma" operator (=>), 850
command characters (see special characters)
command command, disabling shell function lookup, 523
command directories, 703
command editing mode, 705
command interpreters (see shells)
command line, 542-570
aliases for arguments, 572-574
as shell scripts, 698
awk, 379
building strings with { }, 545-547
completion features, 549-553
command-specific completion, 551
editor functions for, 552
Emacs, 360
Emacscommand completion (see command line)
filename completion, 550
filename completion, ignoring file suffixes, 553
menu completion, 551
editing on, 80, 594, 609-615
bash shell, 614
Emacs editing mode, 611
ksh (Korn shell), 10, 613
tcsh shell, 611-613
vi editing mode, 610
zsh shell, 615
executing commands with long list of files as arguments, 563
finding last argument on, 749
interactive applications, controlling with Expect program, 567-570
interpretation by shell, 7
multiline commands and secondary prompts, 559
parameters, unsetting, 749
parsing, 520
repeating commands, 554
at set intervals, 558
copy and paste, using, 557
with variations, 554-557
reprinting wilth CTRL-r, 543
saving to file, 12
sed editor, 669
separating commands with semicolon (:), 563
shortcuts, 542
string-editing (:) operators, 547-549
submitting for execution at a later time, 495
too many arguments, dealing with, 565-567
command search path (see search path)
command substitution, 527, 542, 561
Bourne shell quoting and, 528
examples of, 563
excluding files from rm command, 275
find command output, using with, 174
in for loops, 728
grep command, using in vi editor, 562
nested, 768
command-line arguments
@ARGV array passed to Perl scripts, 844
finding last, 749
handling in Bourne shell scripts, 725-729
for loops, using, 726
parsing, 734
parsing standard, 730-732
of a process, 466
quoting, 734, 779
setting and parsing, 733
starting with - (dash), 728, 734
storing single-line string in, 766
tar, correct order for, 804
testing with case statement, 770
command-line parameters (see command-line arguments)
commands
ampersand (&) character at the end of, putting into background with, 454
awk utility, categories of, 381
binding to keys, 613
built-in, 8, 452
faster prompt setting with, 74
combining with grouping ( ) operator, 893
custom, creating, 571-592
Bourne-type aliases, 574
if-then-else, putting in C shell alias, 579
Korn shell aliases, 575
shell functions, 581-592
sourceable scripts, 576-578
zsh aliases, 576
default, specifying shell with #!, 516
displaying running commands, 504
ex editor, 370-372
exit status of, 715
external, shell execution of, 514
filtering text through with vi editor, 322
fmt command, neatening lines with, 333
finding where located, 33
functions, working with, 585
history of, 593-616
in .exrc file for vi editor, 335
interactive, 7
internal and external, 13
interpretation by shells, 513-??, 513, ??-541
arguments passed to a script, showing, 518
Bourne shell quoting, 526-531
C shell quoting, 531-534
choosing built-in, external or shell functions in bash, 523
choosing built-in, external, or shell functions in C shell, 524
evaluation of command line, 521
executing external commands, 514
interactive use vs. shell scripts, 515
overwriting files accidentally, 517
quoting with here documents, 534
redirections, 526
running other programs, 515
search path for commands, 518-520
wildcards in aliases, 520
joining with pipes, 698
in .logout file, 89
logout file, creating for Bourne and Korn shells, 90
multiple control commands, while loops with, 753
naming, 736
null, 717
PATH environment variable, 709
periodic, 87
preprompt, 87, 88
printed in parentheses by ps, 462
printing
without executing (:p operator), 548
System V, 916
putting names of into shell prompts, 79
redefining with aliases, problems with, 579
redirection (see redirecting input and output)
remote-login utilities, 449
repeating (see repeating commands)
running at login, 50
running one while using another with shell escapes, 326
search path, 699
rehash command, updating with, 150
search table (C shells), resetting, 699
sed editor, 689
operations of, 688-690
sed, order of, 674
sequences of, executing automatically with Emacs, 356
standard input, reading, 885
storing for startup of vi, 334
Tcl, 567
typing at the shell prompt, 454
versions, 702
versions of, 36
vi editor
custom, creating, 336-352
line vs. character, 331
commenting
: and #, beginning with, 742
#, shell understanding of, 744
Bourne shell
using : in place of #, 746
for ease of use, 725
in zsh, 615
RCS files, 815
shell scripts, 699
smb.conf files, 952
in X resource files, 130
comments
in crontab entries, 491
in Emacs editor, 361
in .exrc file for vi editor, 335
lines in program comment block, cleaning up, 394
committing modifications to CVS files, 819
Common Unix Printing System (CUPS), 933
communicating with Unix, 6
communications utilities, 28
compare
two most recent revisions of several RCS files, 818
comparing
files, 213
cmp program, using, 226
diff commands, using, 218-226
make program, using, 230-233
file-times, exact comparisons, 179
lines for uniqueness (uniq command), 418
numbers, 777
strings for pattern matching, 635
word counts in two files, 303
complete command, 551
completion features of shells, 549-553
editor functions for, 552
filename completion, 550
ignoring file suffixes, 553
menu completion, 551
Comprehensive Perl Archive Network (CPAN), 431, 841
Comprehensive TEX Archive Network (CTAN), 929
compress command, 284
compressed files
encoding into 7-bit representation, 407
filename extensions, 17
manpage, finding with grep -Z, 35
tar archive, 788
tar utility
gzip and bzip2 utilities, 790
compressing a directory tree, 284
fine-tuning, 288
compressing files, 281-284
compression
bzip2 utility, 283
GNU tar archives, 813
gzip
unpacking tar archives, 888
tar archives, advantages and disadvantages, 794
Computer Emergency Response Team (see CERT)
concatenate (see cat command)
concatenating strings with . operator, 846
concatenation in regular expressions, 635
Concurrent Version System (see CVS)
conditional expressions (see expressions, conditional)
configuration files
bash shell, 47
C shells
reading at different times, 51
configure.in file (Makefile.in), 825
daemons, rereading of, 471
/etc/inetd.conf file, 942
etc/inetd.conf file, 1011
.exrc for vi editor, 334
ifconfig, for network devices, 939
kernel, device lines from, 902
Korn shell, 47
login shells
contents of, 49
man (/etc/man.config), 33
named.conf, 947
pathnames in, 51
shells, 44-47
automatic terminal setups, 54-60
C shell, 46
.cshrc.$HOST file for per host setup, 60
system-wide setup, 45
smb.conf, 952
sources.list, 832
system, 823
tcsh shell, 47
for vi editor (.exrc), 312
zsh shells, 47
configuration information, manipulation in DoS attacks, 973
configure command, 952
configuring
anonymous FTP server, 944
color ls, 159
devices, user-space tools for, 900
filesystem mounts, 905
installed software packages, 831
kernel, 902
Message Transfer Agents (MTAs), 945
modems, 910
network devices with ifconfig, 908
USB, 911
workstations with DHCP, 947
configuring terminals, 92-123
finding terminal settings with stty command, 104
hung terminals, fixing, 100-104
querying terminal type with qterm, 97
size of xterm windows, 99
terminal type, setting, 95
xterm, 106-123
copy and paste between windows, 120-122
fonts
changing dynamically, 115-117
menus, 113-114
xclipboard, 117-118
xterms
fonts
selecting, 112
confirming
file deletions with rm -i, 266
substitutions in vi, 315
connectivity, 936-950
configuring anonymous FTP server, 944
DHCP (Dynamic Host Configuration Protocol), 947
diagnosing network problems with ping and traceroute, 941
DNS (Domain Name Service), 945-947
/etc/services (database of well-known ports), 938
firewalls, 949
gatewaying form personl LAN over a modem, 950
gateways and NAT, 948
inetd file, managing Internet services, 942
mail, 944
SSH (Secure Shell), 943
status and troubleshooting, 939-941
TCP/IP addresses and ports, 936-938
consoles
serial, 912
constants, scalars defined as in Perl scripts, 846
constant-width fonts, 112, 116
in xterm, 116
CONT (continue) signal, 468
context diffs, 221-224
continue command, 623, 730
continue command (awk), 384
"control" characters, 9
control characters, 238
Emacs and, 363
ex and vi editors and, 343
od -c command, displying with, 239
quoting in Emacs, 364
storing in shell variables, 783
X event translations, 132
controlling process, 454
controlling terminal, 459
controlling tty, write command and, 473
Conway, Damian, 393
Cooper, Michael, 97
copy and paste
configuring xterms for, 109
repeating command with, 557
in tty-type virtual consoles, 448
into windows running vi, 343
copy command (ex), 370
copying
archives, without asking for password, 799
directory trees with tar and pipes, 216
everything you do into a file with script, 782
files, 201, 213
between filesystems, 203
ownership of copy, 998
scp utility, 944
files to different directories, 760
links, 215
remote files, shortcut for, 546
text with vi editor, 313
copying text
between xterm windows, 120-122
button combinations for selecting in xterms, 109
xclipboard, using in xterms, 117-118
core dumps
eliminating entirely, 281
files, wildcard matching and, 662
limiting file size, 280
QUIT signal, creating with, 469
core flavors of Unix, 6
corrupt files, 794
cos command (awk), 384
count command, 784
counting
characters, lines, and words in files, 303
counting occurrences with vi editor, 320
count.it script, 304
cp command, 30
exit status, 715
-i option, 213
-p option, 1010
cpio command, 805
-cpio operator (find command), 274
cpio utility, 795
cps shell function, 591
CPU
listing usage by processes, 457
/proc/cpuinfo file, 466
CPU time, 503
CPU-bound process, 501
lowering scheduling priority with nice, 506
create function (tar), 809
cron command, 245, 492
cron daemon, 489
cron system, 488, 489-495
crontab entries, adding, 494
execution scheduling, 489
Expect scripts, using, 570
jobs, running on system environment, 489
limiting file size, 281
standard input, including in cron entry, 495
trash directory, cleaning out, 268
crontab command, 494
crontab entries, 489, 490
adding, 494
editing, 494
example, 491
removing, 494
time fields, 490
crontab files, 490
find commands, adding to, 274
personal, 498
crontab system
-e option
finding your files with wrong permissions, 997
crontab.local file, 494
cryptdir script, 570
cryptography
keys, problems with on SSH, 1019-1021
csh (C shell)
at command output, quieting, 496
hangups, background processes and, 445
job control commands, 436
limiting file size, 280
nice command
BSD Unix, 508
System V, 509
PWD environment variable
Emacs and, 363
quoting in scripts, 779
shell variables
listing, 712
stop command, 443
stty -tostop command, background jobs writing to terminal, 445
unlimit coredumpsize command, 281
wildcards, failing to match, 662
.csh filename extension, 18
csh shell, 9
csh time variable, 503
.cshdirs file for tcsh shells, 47
.cshrc file, 46, 52
cd aliases in, 627
color, setting in, 158
if (! $?prompt) exit test, 53
multiline prompt showing directory stack, 84
prompt setting, 76
set echo verbose command, 101
.cshrc files
tcsh shells, use of, 47
.cshrc.$HOST file, 60
CSHRC_READ environment variable, 53
($?CSHRC_READ) prompt test, 53
csplit program, 401-404
-f option, 402
-s option, 402
CTAN (Comprehensive TEX Archive Network), 929
ctime (change time for files), 155
ctime command
time conversion routines, 782
-ctime operator (find command), 178
CTRL -\ (to quit), 103
CTRL key
specifying with stty command, 105
CTRL- command, sending QUIT signal, 469
CTRL-c command
aborting programs, 103
canceling commands with, 610
INT signal, sending, 469
killing foreground job, 436
CTRL-d command
ending scripts, 782
exiting Bourne shell, 516
CTRL-d (end-of-input character), 456
CTRL-g in Emacs, canceling entire operation, 356
Ctrl-M character, 27
CTRL-q command
killing processes, 479
CTRL-q command, restarting stopped output, 102
CTRL-q (Emacs quoting command), 364
CTRL-r (reprint) character, 543
CTRL-s command, 479
stopping output, 102
CTRL-v
escaping keys in vi mappings, 344
CTRL-v
temporarily disabling vi keymaps, 349
CTRL-x in Emacs macros, 356
CTRL-z command, 436, 438, 441, 468
putting jobs in background, 102
stopping a subshell, 455
CUPS (Common Unix Printing System), 933
curl application, 836
current directory, 23, 84, 202, 453
advantages of, 620
alias for, storing in shell variable, 630
determining group file ownership, 998
finding, 621
in C-shell status line, 77
links to, 207
PWD environment variable, 706
quick finds in, 199
in shell prompts, 72
dirs command output, using, 84
multiline C-shell prompt, 76
current job, 439, 442
current process
statistics on, 464
cursor for xterm windows (see pointer)
cursors
moving in vi text-input mode without arrow keys, 349
custom commands, creating, 571-592
Bourne-type aliases, 574
if-then-else, putting in C shell alias, 579
Korn shell aliases, 575
propagating shell functions, 586-591
exporting bash functions, 586
FPATH search path, 587-591
shell functions, 581-592
functions calling functions, 583-585
loops, using, 581
simulating in Bourne shell, 591
sourceable scripts, 576-578
zsh aliases, 576
customization
Emacs, 357, 361
and how to avoid, 358
searches, 362
customizing
X Window System, 128
cut command, 34, 410, 733, 765
who command output, cutting, 562
cutting and pasting text
between vi's, 330
CVS
Emacs support of, 356
cvs
CVSROOT environment variable, 818, 820
CVS_RSH environment variable, 820
remote repositories, 820
repositories, 820
CVS (Concurrent Version Control) system, 373
CVS (Concurrent Version System), 818-821
archiving files, 814
cvs add command, 819
cvs checkout command, 818
cvs commit command, 819
cvs diff, 819
cvs import command, 819
cvs init command, 819
cvs log command, 819
conflicting change, examining log message on, 821
cvs remove command, 819
cvs update command, 819
cvsroot directory for archive storage, 818
cvs diff command, 221
CVSROOT environment variable, 818, 820
CVS_RSH environment variable, 820
cwd shell variable, 84
cwdcmd alias for tcsh shell status line updates, 79
cx script, 1003
D[ Top ]
\d (matching numbers) in Perl regular expressions, 855
d or D (delete) command, sed editor, 692
d or D (delete) commands, sed editor, 690
daemons, 14-16
controlling terminal and, 460
cron daemon, 489
DHCP, 948
inetd
disabling for security, 979
lpd, 923
filters, 932
nmbd, 952
printer, 918
removable media on Linux, 907
restarting with the kill command, 471
Samba
restarting to share printers, 958
SMB, 952
SMB, running, 954
sshd
.pam file, 1015
problems with, 1021
sshd, disabling printing and mail checking for, 1013
tcpd, 980
vold, for removable media, 907
Darwin, 3, 6
adding users to system, 983
enabling root access in, 992
data types
Python, 873
data types (Perl), 845-852
hashes, 850
lists, 849
references, 851
scalars, 845-848
databases
distributed, updating, 232
find command, 190-192
date and time
Bourne shell prompts, putting in, 86
date and time, including in shell prompt, 71
date command, 86
+ option, 170
current date in dynamic shell prompt, 72
dater script, 898
dd command
creating file for debugging purposes, 784
restoring files from remote tape drives, 797
restoring files remotely, 797
dd utility, 396, 410
splitting files with, 401
DDoS (distributed denial-of-service attack), 973
dead links, listing, 169
dead processes (see zombies)
Debian dselect tool (see dselect tool)
Debian Linux (see Linux)
debugging
Bourne shell scripts, 717, 775-784
copying your work with script program, 782
line numbers reset in redirected loops, 776
making a file for testing, 784
numeric tests, errors in, 777
output, piping to pager, 775
quoting command line arguments, 779
saving output in file and displaying on screen, 776
shell variable, 777
shell variables, 777
string test syntax errors, 778
time keeping on Unix systems, 781
unmatched code or fi unexpected errors, 776
unmatched operators, 776
core dumps and, 281
keysyms, 127
network connectivity, 941
Perl code in Emacs editor, 356
recursion depth, messages about, 584
setup files for account with hung terminal, 101
su command, using to emulate accounts, 990
decimal numbers
sorting with sort, 427
declaring variables in Perl, 844
decoding uuencoded tar files, 408
decompressing files
bunzip2 program, 283
dedent script, removing whitespace from text, 121
deferencing references, 852
defining
Python functions, 872
<defunct> status under System V, 470
DEL character, 238
delayed execution, 488-499
at command, 495-498
cron system, 489-495
sleep command, 498
DELETE, 127
delete command (awk), 384
delete command (ex), 371
delete (d or D) commands, sed editor, 690
multiline delete, 692
delete function (Perl), 851
DELETE key, 105
Emacs editor, 354
erase character, 783
location for, 60
redefined, debugging with xevBACKSPACE, 127
delete script, 266
deleted files
archiving on tape, 274
deleted text, recovering with vi editor, 313
deleting
characters from a file with dd, 396
d command, sed editor, 672
directories, 272
duplicate lines, 418
Perl script, using, 430
extra characters with ^, 596
files, 17
by last access date, 274
confirmation before deleting, 265
with Emacs, 355
-inum and -exec operators, using with find command, 180
preventing by making directories unwritable, 265
program for, 265
RCS system, 816
wildcards and, 264
(see also removing files)
files with nonprint characters in names, 166
function definitions, 585
linked files, 206
unconnected symbolic links, 170
deleting files
archiving deleted files with tar, 274
denial-of-service attacks (DoS), 970, 973
comsuming all resources, 973
manipulation of configuration information, 973
physical attacks on equipment, 974
swap space vulnerability in, 975
dependency conflicts in package installation/removal, 830
dereferencing operator (->), 844
deroff command, 306
deroff -w command, 299
desktops
display numbers, 960
Gnome and Enlightenment programs, 15
rdesktop (RDP client for Unix), 965
sharing with VNC, 959-962
connecting to Windows VNC server, 960
setting VNC up on Unix, 960
destroying processes with kill, 470
/dev directory, 823, 887
/dev/null file
examples, 720, 773
redirecting output to, 899
/dev/tty file, 889
/dev/zero file, 899
device drivers, 900
device drivers, resetting to kill processes, 479
"device independent" (DVI) printer language, 930
devices, 900-913
dialup PPP session, setting up, 910
disk partitioning, 903
filesystem types and /etc/fstab, 904
filesystems
removable, mounting/umounting, 906
kernel boot output, reading, 900
kernel configuration, 902
loopback mounts, 907
modems, 909
network, configuring with ifconfig, 908
network filesystems, mounting, 908
not recognized by kernel, 901
serial consoles, 912
sound cards, 911
Universal Serial Bus (USB), configuring, 911
/dev/null file, 193
grep command, using with, 193
replacing log files with symbolic links to, 279
/dev/tty file, 754
df command, 501
output, parsing with sed, 767
DHCP (Dynamic Host Configuration Protocol), 947
NAT and, 949
dialback script, 568
dialup session, setting up, 910
dialup terminal type, 96
dictionaries
ispell program, adding words to, 301
spell program, 301
system word file, 299
dictionary files for spell command, 295
dictionary order, sorting in, 428
dierctory hierarchy, 822
diff command, 218-226
batch editing, use in, 373-375
-c option
added lines, listing of, 223
changed lines, marking of, 222
deletions, listing of, 223
difference sections, marking of, 222
listings, start of, 222
running on lists of files, 566
cmp program vs., 226
comparing sets of files, 213
context diffs, 221-224
cvs, 819
CVS, use with, 815
diff3 script, 220
-e option, 218
output, feeding to patch program, 377
-r option, 213
sdif command, 224
tabstops, problems with, 225
-u option
added lines, listing of, 224
changed lines, marking of, 222
deletions, listing of, 223
difference sections, marking of, 222
listings, start of, 222
dig command, 581, 946
DNS queries with, 940
dircolors command
LS_COLORS environment variable, setting, 159
-p option, 159
dircolors command (GNU), 79
.dircolorsrc file, 159
directories
!$ sequence, 595
absolute pathnames and, 619
aliases for, 575
archived on tape drives, restoring, 796
automatic setup for entering and exiting, 630-632
backing up
excluding files from backup, 799
browsing with shell arrays, 194-197
changing, 622, 630
changing with c (shell function), 627
comparing with diff -r command, 213
contents of, 201
counting files in, 303
current
(see also current directory)
current directory, 453
deep directory tree, finding files in, 173
deleting, 272
directory tree
archives/backups of, 788
changing permissions of, 1001
compressing, 284, 288
copying with tar and pipes, 216
grepping, 192
skipping parts with find command, 199
directory tree, duplicating, 187
dirname command, 752
Emacs editor, viewing and manipulating in, 355
emacs hacks, 366
files, finding, 154-170
change and modification times, 154
oldest and newest with ls -t and ls -u, 155
subdirectories, listing with ls -R, 157
files in, 21
finding files
GNU ls command, features of, 161, 162
listing directories with ls -d, 157
home, 22
finding (for anyone), 629
linking, 210
links to, 207
listing contents with ls -lai command, 206
manual page files, searching for, 35
organization of, 147-153
access, 148
bin directory for programs and scripts, 149
creating many, 151
creating new, 152
naming files, 150
private or personal, 150
ownership, 998
permissions, 995
execute without read permission, 1004
fully accessible directory within unreadable, 1005
search access, 997
search permission, 995
sticky bit and, 999
(see also permissions)
printing files to, 545
remotely mounted, hung terminals and, 101
safer file deletion in, 267
in search path, 518
sharing local with SMB network, 953
sharing with SMB network, 959
subdirectories, 22
creating, 546
temporary changes in, 894
temporary, setting different for vi, 332
/u, 629
write permission, denying to limit file creation, 281
directory stack, 624-626
clearing with dirs -c, 626
clearing with popd command, 626
directorys
moving to temporarily with pushd and popd commands, 624
Dired mode (Emacs), 355
dirname command, 751
bugs in, 752
loops, using with, 752
dirs command, 626
-c option, clearing the stack, 626
output in prompt, using, 84
dirsfile variable for tcsh shells, 47
disabling bash built-in commands, 524
disk controllers, 900
disk quotas, 1009
file permissions, changing without chown, 1010
disk space
hard links vs. symbolic links, 631
reports on, 286
swap space for temporary files, 975
disk space, optimizing, 277-291
compressed tar archive, 788
compressing a directory tree, 284
fine-tuning, 288
compressing files, 281-284
emptyig files, 277
executable binaries, stripping, 289
limiting file sizes, 280
links and, 279
log files and, 279
quotas on disk usage, 290
disks, 900
partitioning, 903
PCs, 904
removable, mounting/unmounting, 906
disown command, 446
vs. nohup, 447
disowned processes
controlling terminal and, 460
killing parent processes by name, 475
display command, vis vs., 559
DISPLAY environment variable, 57, 707, 710
checking setting in xwrist script, 771
hard-coded into shell setup file on remote machine, 143
setting for remote X client, 141
DISTDIR environment variable, 837
distributed database, updating, 232
distributed denial-of-service attacks (DDoS), 973
distribution release for software packages, 833
Distutils program, 870
dmesg command
getting last ten lines from, 243
DNS (Domain Name Service)
cache, checking, 946
NETBIOS name, 954
queries, making with dig, 940
DNS MX (mail exchanger) record for a host, looking up, 581
do command (awk), 384
DocBook, 929
doctor program, 366
documentation
Perl, 839, 843
(see also manual pages
documents, 534
domains, NT, 951
Doman Name Service (see DNS)
DoS (see denial-of-service attacks)
dos2unix application, 822
dot (.) files
showing with ls -a option, 163, 206
wildcard matching and, 660
dot (.) (see ., Under Symbols)
double quotes (see ", under Symbols)
doubled word typing errors, finding, 305
downloading files from the Internet with wget, 834-836
drive controllers
kernel boot output for, 900
dselect tool, 825-832
access method, choosing, 826-828
choosing packages for installation or removal, 828-830
configuring packages, 831
exiting, 832
exiting select function, 830
installing packages, 831
removing packages, 831
updating information on available packages, 828
du command, 304
-k option, 287
-s option, 288
dump command
arguments, correct order for, 805
industrial strength backups with, 806
dumping files to the screen, 234-246
cat command, 234
duplicate lines, deleting, 418, 427
Perl script, using, 430
DVD-ROMs, 906
DVI ("device independent") printer language, 930
DVORAK keyboards, 125, 126
dynamic expansion in Emacs, 361
Dynamic Host Configuration Protocol (DHCP), 947
dynamic IP addresses, 937
dynamic prompts, 71
simulating, 72
E[ Top ]
each function (Perl), 851
EBCDIC, converting ASCII to, 410
echo command
awk or cut, using with, 765
backslashes (\) in shell quoting and argument separation, 540
checking shell interpretation of regular expression special characters, 634
ending with n>&m operator, 722
escaped characters, handling, 753
external versions of, 524
opttest script (example), 731
PATH for directory, finding, 149
printing value of individual shell variable, 713
showing values of variables, 704
storing control characters in shell variables, 783
testing filenames with wildcards in them, 166
turning off for secret answers, 761
writing special escape sequences, 77
zmore script, use in, 722
echo shell variable, 534
ed editor, 218, 367
batch editing, example of, 375
diff command, using with script, 373
ex commands and, 370
failure on big files, 376
search and replacement patterns, regular expression metacharacters in, 652
-edit option (xrdb), 138
editing
advanced techniques in Emacs, 356
columns, creating automatically with column, 413
command-line, with ksh, 10
history and variable substitutions with : (colon) string editing operators, 547-549
interactive, on command line, 594
interactive, on shell command line
command history, 609-615
paired item checking in text, 305
scripts for, 390-420
behead script, removing mail/news headers, 395
centering lines, 397
cutting columns or fields, 410
encoding binary files into ASCII, 406-410
fmt.sh, 392
joining lines with join, 417
making text in columns with pr, 411-413
offset script, indenting text, 396
pasting into columns, 416
program comment blocks, cleaning up, 394
rotating text with rot, 419
splitting files by context (csplit), 401-404
straightening jagged columns columns, 415
text conversion with dd, 410
translating characters with tr, 404-406
uniq command, 418
writing, 368
spell checking (see spell checking)
editing modes (command), 705
editing modes, Emacs, 356
EDITOR environment variable, 705
editors
batch, 367-389
awk, 367
ed, 367
ex, 367
line addressing, 369
patch, 367
sed, 367
(see also entries under individual editor names)
completion, functions for, 552
EDITOR environment variable, 705
Emacs, 308, 353-366
(see also Emacs editor)
file ownership and, 999
ignoring signals, 469
locking files before editing, 773
Python, 871
sed, 668-697
vi, 308-335
running ex scripts in, 373
(see also vi editor)
vim, 308
egrep command, 192, 247, 250
case-insensitive searches, faking, 258
extended regular expressions, use of, 637, 645
-f option, 251
-i option, 34
picking processes to kill, 477
regular expression, building for, 194
regular expressions to match tar archive filenames, 800
regular expressions used with, search pattern examples, 654
running on RCS files, 253
-v option
excluding files from deletion, 275
eight-bit filenames, deleting files with, 271
elapsed time, 503
elif statement, 717
else statement, 717
using while leaving then empty, 746
Emacs editor, 308, 353-366
advantages of, 353
backup and auto-save files, 358
backup files, 17
ignoring with ls -B, 161
built-in editor functions in pdksh shell, 613
command completion, 360
command-line editing, 611
customization, 361
and how to avoid, 358
deleting characters and lines, 354
directories for hacks, 366
.emacs file
abbreviations in, 365
search customization file, adding to, 362
exiting, 354
features, listing of, 354
cusomization, 357
editing modes, 356
FTP, 357
HTTP, 357
keyboard macros and advanced editing, 356
mail, 357
mouse, not having to use with, 355
windows, 354
file ownership, 999
insert mode vs. overwrite, 360
inserting binary characters into files, 363
moving around in, 354
online help, key bindings abbreviations vs. those used in this book, 354
psychotherapist program, 366
PWD, unsetting before using, 363
searches, customization of, 362
shells, running in, 355
signals, ignoring, 469
starting, 354
temporary files generated by, 629
undoing actions, 354
.emacs initialization file, 358
.emacs_ml file, 361
email
header and body, proper formation of, 410
MH system, command completion for, 551
reformatting messages for xterms, 120
shortcut for multiple addresses, 546
SMTP (Simple Message Transfer Protocol), 944
(see also mail)
empty files, 193, 898
empty num variable, numeric test error, 777
empty passwords, SSH server and, 1015
emptying files, 277
emulating Windows API (wine program), 962
enable command, 524
encoding
binary files into ASCII, 406-410
MIME encoding, 408-410
uuencoding, 407
full binary text with base64, 408
encrypting all files in a directory (crypdir script), 570
end anchor ($) in regular expressions, 638
end of a file, displaying with tail command, 242-245
End of file unexpected error, 775
exit early, using to find error, 776
END pattern, awk, 380
endless loops, 746
starting with shell functions, 523
end-of-file character (expect eof command), 569
end-of-input character (usually CTRL-d), 456
end-of-line characters (see newlines)
Enlightenment, 15
enscript program, 922
.enter file, 631
entering directories, automatic setup for, 630-632
env command, 465, 704, 712
checking for environment changes at different systems, 57
running scripts from kernel, 745
ENV environment variable, 706
Bourne shells, setting up, 45
Korn shells, setting, 47
environment, 453
current process, finding for, 465
temporary changes in, 894
environment variables, 453, 702-711
AT, 54
CBLKWID (comment block width), 394
CDPATH, 622
CLICOLOR, 161
in .cshrc.$HOST file, 61
CSHRC_READ, 53
CVSROOT, 818, 820
CVS_RSH, 820
DISPLAY, 143, 710
setting for remote X client, 141
DISTDIR, 837
EDITOR, 705
ENV, for Bourne shells, 45
EXINIT, 312, 333
FPATH, 587-591
HISTFILESIZE, 606
HISTSIZE, 593, 606
$HOME, 148
HOME, 629
$HOME and $LOGDIR, 51
LINES and COLUMNS, 59
LOGDIR, 629
LS_COLORS, 159
LSCOLORS, 161
MANPATH, 33, 66
modification by programs, 737
names, 704
PATH, 708
path shell variable and, 709
predefined, listing of, 705-707
PWD, 363
SAVEHIST (zsh), 606
setting in shell setup files, 50
SHELL, 100
shell functions and, 582
shell functions, changing for, 586
shell variables vs., 703, 711
SHLVL, 82
system-wide setup, 45
C shells, 46
TERM, 55, 94
terminal setup, testing for, 57
WINNAME, 59
WORDLIST, 297, 301
zsh shells, 47
epoch, 781
eq operator, 846
equality
ne (string inequality test) operator, 846
erase character
# as, 106
BACKSPACE, 783
DELETE, 783
erase character, setting automatically for X terminals, 54
erase characters, setting, 104
error messages
program names included in, 736
scrolling off screen, 890
signals as, 468
(see also standard error)
errors
End of file unexpected, 775
exit early, using to find error, 776
unmatched operators as cause, 776
fi unexpected, 776
line #: ;; unexpected, 776
numeric test syntax errors, 777
stderr (see standard error)
string test syntax errors, 778
wildcard matching failure, 662
ESC key
file completion and, 553
ESC Z string, 98
escape sequences
copied by script program into files, 782
for colors, 158
nonprinting, in shell prompts, 80
prompt settings and, 80
titlebar text, changing in xterms, 111
writing with echo command, 77
xterm VT Fonts menu, 116
escaping regular expression metacharacters, 638
ESC-x in Emacs, 354
/etc directory, 823
/etc/apt directory, 832
/etc/csh.cshrc file, 46
/etc/csh.login file, 46
/etc/fstab file, 904
shared filesystems in, 909
etc/group file
passwords, 998
/etc/hosts file
IP address to hostname mapping, 945
/etc/hosts.allow file
hosts.allow file
tcp_wrappers package, 942
/etc/hosts.equiv file, 142
/etc/inetd.conf file, 942, 1011
Samba daemons, adding to, 954
swat, adding to, 956
/etc/inputrc file, 47
/etc/man.config file, 33
/etc/nologin file, 43, 993
/etc/passwd file, 25
documentation on System V machine, reading, 32
Samba authentication, using for, 955
storing passwords on Mac OS X, 11
/etc/profile file, 45
Korn shell, 47
/etc/securetty file
disabling root access, 990
/etc/services file, 938
swat tool, 956
/etc/ttys file, 37, 58
/etc/ttytab file, 58
ethereal program, 942
Ethernet address, 948
ethernet cards, 900
eval command, 96, 521
awk compared to, 724
last parameter from command line, picking, 749
resize output, evaluating, 100
scanning contents of variables, 751
sed, using with, 768
evaluating
expressions, 183, 635
multiple commands, 567
event translations, 130-133
overriding default, 132
translation table, 131
events, 131
ex command, line-numbering with, 246
ex editor, 367
appending to file, 317
batch editing, example of, 375
capitalizing words, 320
commands, 370-372
confirming substitutions, 315
deleting by patterns, 318
ex command mode in vi, 349
file recovery, 324
global command, 315
line addressing, 369
multiple setup files, 321
protecting vi keymaps from interpretation by, 343
quoting | (vertical bar), 344
regular expressions used in
search and replace commands, 655
running scripts in vi, 373
saving part of file, 316
search and replacement patterns, regular expression metacharacters in, 652
search patterns and global commands, using, 314
settings, 312
startup commands, 312
switching between files, 309
yank buffers, 311
exchange command (x), sed editor, 681, 688
excluding files from deletion, 275
exec command, 745
manipulation of file descriptors, 746
replacing one shell with another, 745
typing at shell prompt, 452
-exec operator (find command), 179
{ } operator, using with, 187
creating custom tests, 181
using with -type and -name, 183
xargs command vs., 180
exec system call, 514
typing at a shell prompt, 452
executable files
#!, making directly executable with, 741
chmod command, 12
external, tracking locations with aliases, 575
last-access time, 156
locating for programs, 33
multiple commands linked to a file, 748
permissions on, 699
strip command, 289
execute permission
changing with chmod, 1000
for directories, 995
script for changing, 1003
shell scripts, 1009
without read permission, 1004
execution, delayed (see delayed execution)
execution statistics, report summarizing, 456
exim program, 945
EXINIT environment variable, 312, 333
exists function (Perl), 851
exit ( ) function (Perl), 845
exit command
awk utility, 384
effect on subshells, 456
ending scripts, 782
lpc, 918
reading logout file when using, 52
.exit file, 631
exit status
dead processes and, 480
diff and cmp, returned by, 226
of loops, 753
of pipelines, 716
printing for any program not returning zero, 716
returned by : operator, 746
returned by processes, 455
reversing for command line in bash and zsh, 716
rm and rm -f command, 269
sh -e command, 760
testing with if statement, 716-718
testing with loops, 719
of Unix processes, 715
values for expr, 762, 764
zero, 719
exit test, if (! $?prompt), 53
exiting
directories, automatic setup for, 630-632
Emacs, 354
loops, 853
shell to close a window, 482
exp command (awk), 384
expansion of wildcards by shells, 521
quoting regular expressions to prevent, 634
shortcuts, 780
expect command, 567
expect eof command, 569
Expect programs, 567-570
automating /bin/passwd, 568-570
cryptdir script, 570
dialback script, 568
passmass script, 570
rftp script, 570
Tcl language, writing in, 567
testing interactive programs, 570
exporting bash shell functions, 586
expr command, 303, 762-764
arguments
$*, 765
$@, 765
arithmetic operators used with, 762
examples of, 763
exit status values, 762
logical operators used with, 763
matching parts of strings with regular expressions, 765
relational operators used with, 762
syntax, 762
testing character strings, 764
expressions, 183, 633
conditional, 716, 716-718
order of evaluation in Perl, 848
in Python lambdas, 873
regular expressions vs., 635
(see also operators)
.exrc file
local settings for vi, 312
setting up vi editor with, 334
extended expressions, matching more than one process, 477
extended grep (see egrep command)
extended partition, 904
extended regular expressions, 637, 645
extensions, filename, 17
:e string editing operator, 548
wildcard matching and, 660
external commands, 13, 74, 523
C shell, determining whether to use, 524
creating subshell for execution in Perl, 856
executing, 514
setting shell variables with, 86
extract function (tar), 809
F[ Top ]
factorial functions, 583-585
failure of commands, indication in exit status, 715
false (exit status) utility, 715
false values in Perl, 847
fast find commands
database for, 190
databases for, 187
matching shell wildcards, 189
"fat comma" operator (=>), 850
fc command
-e option, starting editor and loading file with recent history, 599
-l option, listing previous commands, 598
fg command, 436, 438
job numbers, supplying to, 439
fgrep command, 193, 247
running on RCS files, 253
fgrep command (fixed grep)
-f option, 251
fi statements, 717
fi unexpected error, 776
fields
in crontab entries, 490
cutting, 410
separating with : (colon), 101
sort command, 422
changing delimiter, 424
fignore shell variable, 553
file access mode (see permissions)
file descriptors, 453
closing, 480
files currently pointing to, viewing, 464
manipulation by exec command, 746
open files and, 753
shell redirecation capabilities, 755
standard error or stderr, 754
standard input or stdin, 754
standard output or stdout, 754
redirecting, 756-759
file permissions (see permissions)
file protection mode, supplying for directories, 153
file protocol (URI types), 832
file utility, 240
File::Find module (Perl), 169
filehandles in Perl, 857
filenames, 150
changing with rename function (Perl), 856
completion by shells, 542, 550
conventions, 16-17
converting form uppercase to lowercase, 404
ending with ~, 629
executable vs. source, 579
extensions for, 17
finding with cat command, 7
links and, 737
path name components, stripping with basename, 751
special characters, quoting in C shell, 533
stripped from pathnames, 752
symbols in, 725
whitespace in, 165
wildcards for, 657-667
failing to match, 662
file's name and extension as separate entities, 660
grep -l command, listing matching files, 664
listing of, 658-660
nom script, listing nonmatching files, 666
pathnames, not using in, 663
shell handling of, 660-662
vgrep script, listing nonmatching files, 665
files, 27
appending to existing with vi editor, 317
backing up, 787-807
excluding from, 799
vi editor, macro for, 351
(see also backup files)
backup and auto-save, Emacs, 358
binary, searching, 259
comparing
cmp program, using, 226
diff commands, using, 218-226
make program, using, 230-233
compressing, 281-284
copying from subdirectories to single directory, 760
counting number in a directory, 303
creating, using wildcards, 544
deleted, archiving on tape, 274
directory contents, explanation of, 201
Emacs editor, viewing and manipulating in, 355
empty, 898
emptying, 277
finding, 154-170
access times, 155
by age and size, 168
change and modification times, 154
counting by types, 167
GNU ls command, features of, 161, 162
listing subdirectories with ls -R, 157
newest file, printing name of, 169
nonprintable characters in filenames, showing, 166
oldest or newest with ls -t or ls -u, 155
showing hidden files with ls -a or ls -A, 163
spaces in filenames, 165
symbolic links, unconnected, 169
type of file in each directory, listing with ls -F, 164
unique filenames, picking automatically, 170
finding with find command (see find command)
hosts.equiv, 142
inodes, 262
linking, 203-212
creating and removing links, 208
directories, linking, 210
directory, links to, 207
filenames for symbolic links, 212
links, types of, 205
reasons for, 203-205
stale symbolic links, 209
lockfiles, 772-774
modification by attackers, checking for, 977
names for (see filenames)
newly created, setting default mode in unmask, 985
old and new version, saving with vi editor, 316
open, and file descriptors, 753
overwriting accidentally, 517
ownership of (see ownership, file)
packing up and moving (see archives)
permissions for (see permissions)
printing
shortcut for, 546
(see also printing)
Python, opening, closing and reading, 875
reading to/writing from, 885, 889
(see also redirecting input and output)
recovering with vi -r command, 324
recovered buffers, cautions about, 325
remote, copying to local system, 546
removing (see deleting; removing files; rm command)
renaming
copying or comparing set of, 212
interactively, 213
saving part of with vi editor, 316
searching
by column, using awk, 258
with grep commands, 247-261
look program, 259
rcsgrep script, 252
security (see security)
showing contents of, 234-246
cat command, 234
cat -v or od -c, showing nonprinting characters, 237-239
displaying end with tail command, 242-245
file types, finding, 240
head, displaying beginning with, 246
less and more pagers, 236-237
numbering lines, 246
squashing extra blank lines with cat -s, 241
size of
batch editing and, 376
limiting, 280
splitting by context (csplit), 401-404
switching among with vi editor, 309
temporary, 629
handling text with, 563
testing, 735
uncompressing, 721
filesystem check (fsck) program, 16
Filesystem Hierarchy Standard (FHS), 822
web site information on, 823
filesystems, 904
navigating Unix filesystem, 617-632
cd, speeding up with aliases, 627
changing directories, 622
changing directories with c (shell function), 627
current directory, 620
current directory, finding, 621
directories, automatic setup when entering/exiting, 630
home directory, finding (for anyone), 629
loop control, break and continue, 623
marking your place with shell variable, 630
relative and absolute pathnames, 618
shell pushd and popd commands, 624-626
NFS and SMBFS, mounting, 908
Perl functions for, 856
/proc, 463-468
removable, mounting/unmounting, 906
synchronizing with rsync program, 374
for USBs, 911
filtering text through Unix commands
fmt command, 343
greps, 256
filters, 9, 754
apsfilter, 932
for graphics, 933
grep command as, 249
lpd daemon, running files through, 924
find command, 171-200
$( ) operator, used with, 769
-atime operator
locating files based on last access time, 274
clearing out unneeded files with, 276
-cpio operator
archiving deleted files on tape, 274
directory tree, delving through, 173
duplicating a directory tree, 187
-exec operator
creating custom tests, 181
-exec operator
large recursive greps, using for, 182
-exec option, 1002
-exec option
changing permissions for directory tree, 1001
fast find commands, 174
database for, 190-192
matching shell wildcards, 189
fast find databases, using, 187
features and basic operators, 171-173
filename-matching patterns, 634
files for compression, 288
files you own with wrong permissions, 997
finding many things with one command, 182
grepping a directory tree, 192
hard links to a file, finding, 197
-inum operator, 272
lookfor script, using in, 193
loops using, 752
-maxdepth operator, 272
modified files, checking for, 978
-mtime operator, 175
-name operator, 175
networked filesystem, preventing from searching, 200
-newer option, using in incremental file backups, 799
-nouser or -nogroup operators, 186
-ok option, 265
old files, searching for, 175
operators, 249
-perm operator, 185
-prune operator, 198, 272
quick find in current directory, 199
-regex and -iregex options, 634
running commands on results, 179
search operators, 176-178
-size operator, 185
skipping parts of directory tree, 199
time operators (-mtime, -atime, and -ctime), 178
exact file-time comparisons, 179
-type operator, 184
unconnected symbolic links, finding, 169
-user and -group operators, 186
xargs command, using with, 174
finding
current directory, 621
file types, 240
home directory (for anyone), 629
findpt alias, 249
firewalls, 949
gateways functioning as, 948
fixed dynamic addresses, 948
fixed grep (see fgrep command)
fixed length records, converting to/from variable-length records, 410
flags
displaying current, 49
flavors of Unix, 6
floating-point numbers
Perl data type, 845
sort command and, 427
floppies, 906
backing up to, 794
loopback mounts, 907
flow-control operators for loops (in Perl), 853
fmt command, 391
disk initializer command, 392
ending punctuation for sentences and, 392
filtering text from vi editor through, 343
filtering vi text through, 333
-p option, reformatting program source code, 392, 394, 395
reformatting fortune with, 772
-tuw options, 391
fmtarg variable (xmessage utility), 772
fmt.sh script, 392
fold utility, 391
font resource (xterm), 112, 115
fonts
default, 112
selecting, 112
xterm, changing dynamically, 115-117
VT Fonts menu, 115
xterm, VT Fonts menu, 113, 114
for command (awk), 385
for loops, 12, 384, 559, 853
break and continue commands in, 730
break and continue, controlling with, 623
command-line arguments, handling with, 727, 728
commands, varying while repeating, 554, 556
here documents, using to print form letters, 560
in command-line arguments, 726
with multiple variables, 750
sed scripts, use in, 670
standard input, stepping through, 750
wildcards, using with, 728
forcing file removal/moving without warnings, 1002
foreach loop, 554
foreach loops, 559
commands, varying while repeating, 554
iterating through arrays, 849
iterating through list elements, 853
foreground color, 159
foreground jobs
interrupting with notification of state change in background job, 445
killing, 469
nice command and, 510
foreground processes, 435
process group and, 453
fork system call, 452, 514
processes forking out of control, 478
format
tape drives, 792
formatted manpage files, 35
formatting
markup languages for, 928
formatting Python output, 875
Fortran program source file extension, 17
fpath array (zsh), 587
FPATH environment variable, 587, 587-591
Korn shell, 588
zsh shell, 590
free disk space
checking with df, 501
free memory
information about, 463
Free Software Foundation website, 814
FreeBSD, 6
sections, searching in manpages, 32
FreeBSD Unix
disk partitions, 904
enabling gatewaying, 949
ifconfig file output, 939
inetd.conf file, 942
info command, 38
installing software with FreeBSD packages, 837
kernel boot output for devices, 900
OpenSSH, 1012
serial consoles, 913
single user mode, 985
software installation with FreeBSD Ports, 837
software installation with Ports system, 822
strings utility, searching for words in binary files, 259
swapinfo utility, 976
fsck (filesystem check) program, 16
-fstype operator (find command), 200
FTP
anonymous ftp, 534
anonymous FTP server, configuring, 944
Emacs facility for, 357
ftp program, 29
ftp protocol (URI types), 832
securing with port forwarding, 1028
function keys, mapping in vi, 338
functional programming languages, functions in, 872
functions
buffer overflow, causing, 972
built-in editor functions, tcsh, 611-613
C language, boundary checking, 972
@-functions, vi editor, 340-343
combining, 341
defining and using simple, 340
newlines in, 342
reusing definition, 342
Perl
exit( ), 845
filesystem, 856
hash functions, 851
print, 848
Python, 872
anonymous, creating, 872
class methods, 873
defining, 872
shell, 13, 523
(see also shell functions)
tar utility, 809
G[ Top ]
:g (global) operator, 604
g or G (get) commands, sed editor, 603, 688, 690
G (Get) command, 684
/g regular expression modifier, 856
gateways, 948
functioning as firewalls, 950
personal LAN over a modem, 950
gawk utility, 379
paired item check script, 305
standard I/O, 887
variables, 382
version history, 388
geometry variable (xmessage utility), 772
get command
copying files from remote host to Unix machine, 959
get (g or G) commands, sed editor, 688, 690
G (Get) command, 684
getline command (nawk), 385
getopt command, 728
parsing output, 731
getopts command, 729, 731
getty program, 435, 437, 452
Linux virtual consoles, use in, 447
GID (group ID), 453
primary group, finding for, 986
zero, for superuser group, 983
global aliases, 576
global command (ex), 371
global commands, using in vi editor, 314
global searches, 315
global commands with pattern matches, 318-320
global crontab entries, 494
global (:g) string editing operator, 548
global initializations (Emacs), disabling, 358
global replacements, 315
globbing
enabling/preventing in shells, 660
shell failure to match wildcards and, 662
Gnome, 15
GNU
autoconf and automake utilities, 825
context greps, 254
dircolors command, 79
Emacs
(see Emacs editor)
fast find utility (locate), 187
find command, {} and, 181
head command, 246
ls command, 161
displaying color names, 158-161
-Q (quoting) option, 165
slocate command, 187
spell, download site for, 296
tail program, 244
- -follow option, 245
- -follow=name and - -retry options, 245
tar command, 285
tar utility, 788
command-line arguments, order of, 805
gzip and bzip2 options, 790
remote tape drive, using with, 798
storing absolute pathnames, 804
wildcards, using with, 801-803
wget utility, 834-836
GNU Readline, 47
GNU-Darwin auto-installer for OS X (One-Step), 836
GNUS (Emacs Usenet client), 357
gprof profiler, 501
grabchars program, 723
graphical user interfaces (see GUIs)
graphics
conversion programs, 933-935
graymaps, 934
greater than (>) operator, 762, 846
greater than or equal to (>=) operator, 847
greedy and non-greedy regular expressions, 645
grep command, 247-261
-c option
listing nonmatching files, 664
cgrep script, 690-692
-e option, 666
-exec operator (find command), using for, 182
finding commands containing the word "error", 561
finding file with particular word or string in it, 192
-l option, 562
listing matching files, 664
lookfor script, using in, 193
-n option, number lines with, 246
piping output to pager, 890
redirecting output, 754
regular expressions, evaluating and matching, 635
regular expressions, use of
printing every address in your incoming mailbox, 639
regular expressions used with, search pattern examples, 654
-v option
excluding files from deletion, 275
who command, using with, 38
-Z option for compressed files, 35
grep commands
agrep, 247, 251
case-insensitive searches, 258
compound searches, 256, 257
egrep, 247, 250
egrep -f and fgrep -f, 251
fgrep, 247
GNU context greps, 254
-A option, 254
-B option, 254
-C option, 254
grep, 247
-c option, 249
-i option, 249
-l option, 249
ps command, using with, 249
-v option, 249, 258
-w option, 249
highlighting text with hgrep, 260
multiline context grep using sed, 255
rcsgrep, 248, 252-254
running on RCS files with rcsgrep script, 253
searching files for matching line of text, 8
very fast versions (such as GNU grep/egrep/fgrep), 248
group ID (see GID)
-group operator (find command), 186
grouping operator (( )), 177, 251, 645
groups
denying permissions with, 988
file ownership, 995
file ownership, determining, 998
group ownership and, 986-988
ownership of files, changing, 856
ownership of files in directories, 149
permissions
denying, 996
directory with setgid bit, 985
listing for files, 1007
setting to same as file owner, 1001
process groups, 453
Unix user/group infrastructure, 982
groups command, 987, 1007
gsub command (awk), 385
:gt operator (C shell), 85
gt operator (Perl), 846
guest accounts, 953
GUIs (graphical user interfaces), 7
operating systems, 5
Python, 875
Tcl/Tk commands for, using in wish shell, 10
wrapping interactive programs with, using Expect, 570
gunzip utility, 282
-c option, writing uncompressed data to standard output, 283
-N option, 282
recreating original tar files with, 408
gzcat command, 283
gzip utility, 281, 790, 794
gzip -c command, 888
gzip -l command, 282
H[ Top ]
h or H (hold) commands, sed editor, 688
h command, 690
hacking, 5
handlers for DDoS attacks, 973
hangups, background processes and, 445
hangups (see HUP signals)
hard disk quota limits, 290
hard drives, 900
hard links, 205, 210
broken, 208
copying, 215
disk space and, 280
finding for files, 197
-i file in home directory for confirmation of file deletion, 267
symbolic links vs., 206
tar -l command, printing messages about, 285
to .enter and .exit files, 631
hardware, 900
dialup PPP sessions, 910
disk partitioning, 903
PCs, 904
filesystem types and /etc/fstab, 904
filesystems
mounting NFS and SMBFS, 908
kernel boot output for devices, 900
kernel configuration to support, 902
modems, 909
network devices, configuring, 908
/proc filesystem files, 466
serial consoles, 912
sound cards and other, 911
supported hardware lists, 912
USB configuration, 911
hash codes, 300
hash command, 520
hashes (Perl), 845, 850
functions for, 851
iterating over, 850
head command, 169, 246, 784, 899
-c option to print characters/bytes, 246
GNU version, -c nk and -c nm options, 246
-n option to control number of lines displayed, 246
head of a pathname (:h operator), 547
headers, mail
creating with cat, 409
proper formation of, 410
removing with behead script, 395
help, 32-40
command versions, 36
info commands, 38-40
man command, 32
searching online manual pages, 34
terminals, tty command, 37
Unix system names, 36
whatis command, 33
whereis command, 33
who command, 38
help command (lpc), 918
here documents, 534, 560
hereis document terminators, 761
hgrep script, 260
hidden files, listing with and ls -a and ls -A, 163
hierarchy, filesystem, 822
highlighting, 159
hgrep script, using, 260
in shell prompts, 79
histchars shell variable, changing history characters with, 615
histfile shell variable (tcsh), 47
HISTFILESIZE environment variable, 606
history command, 593
-d and -f options, showing dates and times, 599
-D option, showing elapsed time, 599
-h option, 609
listing specified number of previous commands, 597
-r (reverse) option, 609
bash shell, cautions about using, 598
-w option, 609
.history file, 606
tcsh shells, 47
history number in shell prompts, 72, 594, 598
multiline C-shell prompt, 76
history of commands, 10, 593-616
!$ sequence for safety with wildcards, 597
changing history characters with histchars, 615
checking with :p operator, 605
history numbers, 597-599
history substitution
!$ sequence, 595
mkdir command, using with, 153
!:n* sequence, 595
history substitutions, 599-604
narrowing searches with, 257
passing to other shells, 608
repeating commands with, 558
saving history in history file, 606-608
bash, ksh, and zsh shells, 606
C shells, 607
shell command line-editing, 609-615
bash, 614
Emacs editing mode, 611
ksh (Korn shell), 613
tcsh shell, 611-613
vi editing mode, 610
zsh, 615
history shell variable, 712
history substitution, 573, 594, 599-604
disabling in bash, 616
editing substitutions in C shells, zsh, and bash, 547-549
for loop, using for, 554
HISTSIZE environment variable, 593, 606
HOBLink JWT RDP client, 966
hold (h or H) commands, sed editor, 681, 688
h command, 690
HOLD SCREEN button, 102
hold space (sed editor), 690
transforming part of a line, use in, 683-685
home directory, 22
bin subdirectory, creating, 149
finding, 148, 629
HOME environment variable, 706
pathname of, 51
$HOME environment variable, 51, 148
HOME environment variable, 629, 706
$HOME/.rhosts file, 142
host allow directive, 953
host tool, 946
host-based access control, 143
host-based modems, 910
hostname command, 36
hostnames
completion by shells, 551
for IP address, finding with dig -x, 941
mapped to IP addresses by DNS, 945-947
NETBIOS, 954
in shell prompts, 71
multiline C-shell prompt, 76
showing with who am i command, 56
hosts
.cshrc.$HOST file for per host setup, 60
trusted-host authentication on SSH, 1016
hosts.equiv file, 142
HTML, 929
converted into PostScript, 931
editing files with batch editing script, 375
file extensions, 17
htmllib and HTMLParser modules, 876
HTMLParser module, 878
HTTP
Emacs facility for, 357
URI protocol types, 832
hung terminals, fixing, 100-104
aborting programs, 103
output stopped by HOLD SCREEN or SCROLL LOCK button, 102
program waiting for input, 102
stalled data connection, 102
stopped jobs, checking for, 102
HUP (hangup) signals, 468, 471
ignoring with nohup command, 445
.hushlogin file, 43
hyphen (see - (dash), under symbols)
HZ constant, frequency of system time updates, 781
I[ Top ]
ICA client, installing, 964
ICMP (Internet Control Message Protocol), 936, 937
diagnostic and traffic control messages, 938
icons
navigation, for resources shared with SMB network, 956
text, setting for xterms, 111
IDE (Integrated Development Environment), Emacs as, 356
identifiers
group ID (GID), 453
process ID (PID), 453
user IDs (UIDs), 453
(see also entries under identifier names)
identity, Python objects, 873
if (! $?prompt) exit test, 53
if command (awk), 385
if statements
: used as do-nothing place filler, 746
debugging, 776
syntax for Bourne shell, 717
test command, using with, 735
testing exit status with, 716-718
in xmessage command line, 771
ifconfig tool, 900, 908, 939
if/else block, testing multiple conditionals in, 717
IFS (internal field separator) shell variable, 766
if-then-else loops
cgrep script, using in, 692
csh aliases, use in, 579
Perl scripts, using in, 852
ignoreeof variable, 90
ignoring filenames in ls command listing, 161
@INC array (Perl), 841
module paths in, 844
incremental backups, 798-800
incremental searches in Emacs, 362
indentation
in Bourne shell scripts with <<- operator, 535
Perl script for text, 396
in Python scripts, 871
index command (awk), 385
indexes
Bourne shell arrays, 195
C shell arrays, 195
hashes, 850
industrial strength backups, 806
inequality
!= operator, 846
ne operator, 846
inetd daemon, 942
disabling for security reasons, 979
Expect scripts with, 570
running Samba daemons, 954
infinite loops
tail -f command, creating with, 244
info command, 38-40
inheritance
process information, 454
variables, 711
_ _init_ _( ) method (Python classes), 873
init program, 435, 437, 452
collecting child processes after parent exits, 480
initialization files (Emacs), 358
initializing new cvsroot, 819
inodes, 202, 262
-ctime (change time) operator, using with find, 176
file permissions in, 995
information in, 263
i-numbers for parent directory entries, 207
ls -c command for, 156
ls -i command, listing number for each directory entry, 206
tar utility and, 788
input events, 131
input (see input/output; standard input)
input/output (I/O)
checking statistics for security problems, 977
find command -print0 option, 180
output from at command, quieting, 496
output from background jobs, stopping, 444
output from command, sending to nohup.out file, 445
piping shell loop output to pager, 35
Python, 875
redirecting for programs, 753
redirecting (see redirecting input and output)
stopped terminal output, debugging, 102
(see also standard error; standard input; stardard output)
INPUTRC environment variable, 707
.inputrc file, 47
inputrc file
customizing bash editing in, 614
insert command (ex), 371
insert mode for pasting text, 110
insertion mode (Emacs), 360
installing
Python, 869
installing Perl, 842
installing software, 822-838
challenges of, 824
curl application, using, 836
Debian apt-get tool, using, 832-834
configuring sources.list file, 832
Debian dselect tool, using, 825-832
access method, choosing, 826-828
choosing packages for installation or removal, 828-830
configuring packages, 831
exiting, 832
exiting select function, 830
installing packages, 831
removing packages, 831
updating information on available packages, 828
FreeBSD packages, using, 837
FreeBSD Ports, using, 837
GNU wget utility, using, 834-836
make utility, problems with differing versions, 824
RPM, using, 838
simplifying the make process, 824
/usr/bin and other directories for, 822
instance of an object, application resources associated with, 128
instance variables (Python), 873
instances of Python classes, 873
int command (awk), 385
INT (interrupt) signal, 468
killing processes waiting for NFS resources, 471
sending with CTRL-c command, 469
Integrated Development Environment (IDE), Emacs as, 356
interactive command-line editing, 594, 609-615
bash, 614
Emacs editing mode, 611
ksh (Korn shell), 613
tcsh shell, 611-613
vi editing mode, 610
zsh shell, 615
interactive commands, 7
interactive logins
starting remote X clients from, 141
interactive mode for shells, 515
interactive programs
controlling with Expect program, 567-570
nice command and, 510
testing with Expect, 570
interactive renaming of files, 213
interactive shells, 48, 49
Bourne shell
ENV environment variable, 45
setup files, reading at different times, 52
interactive spell checking, 296
interation in loops, 623
intergers in Perl, 845
internal commands, 13
internal field separator (IFS) shell variable, 766
Internet, 28
Internet Control Message Protocol (see ICMP)
Internet Message Access Protocol (IMAP), 945
Internet Protocol (IP), 936
interoperability
POSIX standard, 6
interpolating variables, 845
interpretation of commands by shells (see commands)
interpreted languages, 869
interpreter
Python, 870
interpreter, perl, 839
interrupt characters, setting, 104
interrupting commands
in a string of commands separated by semicolons, 564
interrupting jobs, 444
interrupts
shell scripts, trapping exits caused by, 721
intr key, 105
intruder detection, 977
-inum operator (find command), 272
-inum operator (find command), 180, 197
i-number (inodes), 262
i-numbers
deleting files by, 272
invalid symbolic links, 209
"inverse if" statement, 717, 718
invisible files, 273
I/O-bound processes, 501
nice command, effect of, 507
IP Control Message Protocol (see ICMP)
IP (Internet Protocol)
addresses
DHCP and, 947
displaying with dig, 941
mapping hostnames to, 945
network devices, 908
private network addresses and, 948
addresses and ports, 936-938
addresses, 937
ports, 937
IP masquerading on Linux, 949
TCP, UDP, and ICMP with, 937
Version 4 (IPv4), 937
Version 6 (IPv6), 937
irc utility, 30
IRIX systems
restricted shell (rsh), 143
isc-dhcpd daemon, 948
ispell program, 296
iterating
through arrays, 849
through key-value pairs in hashes, 850
through list elements with foreach, 853
iterating shell variables over arguments, 779
J[ Top ]
Java
applet VNC client, 959
HOBLink JWT (RDP client), 966
jiffies (hundredths of a second), 464
job control, 326, 435-450
autowrite and, 442
basics of, 437
how it works, 437
using from your shell, 437
Linux virtual consoles, use in, 447
potential problems with, 440
process groups, 453
remote login sessions, stopping, 449
running background jobs without, 446
shell features for, 454
STOP signal, using to stop forking processes, 478
job numbers
putting job into foreground or background with, 440
job numbers, assignment to background processes, 438
jobs, 454
at command, checking and removing, 496
at command, making quiet, 496
current job, 439, 442
deciding when to run, 497
effective use of, 438-440
foreground
killing, 469
killing by process ID number, 436
notification of changed job state, 444
output from background jobs, stopping, 444
previous job, 439
running without job control, 446
stopping to relieve overloaded system, 443
terminating or stopping, control keys for, 105
jobs command, 436, 438
stopped jobs, checking for, 102
join command, 417
jot utility
commands, repeating with, 554
Joy, Bill, 93
K[ Top ]
kernel, 7
backing up, 791
daemons, 14-16
relationship with shell, utilities, and applications, 8
running scripts from, 743
env command, using, 745
script filename as argument, 744
scheduler program, 500
signals and, 468
starting processes, 754
statistics on (/proc/stat file), 464
kernel boot output for, 900
kernels
boot output, reading, 900
configuration, 902
modules for device drivers, 900
PPP code in, 910
recompiling to turn on IP forwarding, 949
Kernighan, Brian, 477
key bindings
bindkey command, 611-613
to built-in Emacs editor functions in Korn shell, 613
key bindings in Emacs, 354
for incremental searches, 362
key definitions, 237
key mappings
.exrc file for vi editor, saving in, 312
keybindings
zsh command-line editing, 615
keyboard macros, Emacs, 356
keyboard shortcuts
command completion in Emacs, 360
vi map commands, 336-340, 344-351
keycode keyword, 126
keymap table, maintained by X server, 124
keymapping, 336
keymaps, vi
cursor motion in text-input mode without arrow keys, 349
further examples of, 347
noremap command and, 350
pasting text into window system running vi, 343
protecting from interpretation by ex, 343
for repeated edits, 345
repeating, 348
(see also map commands, vi)
keys
defining with xmodmap, 124-127
public/private key pair for encrypted information, 943
keys, cryptographic
SSH, problems with, 1019-1021
keys function (Perl), 851
keysym mappings, 124-128
keysyms
debugging, 127
key-value pairs for hashes, 850
kill -9 command, 469
kill character, @ (at sign) as, 106
kill command, 469, 470
aborting programs, 103
closing window by killing its processes, 484-487
shell script, using, 486
web browser (example), 485
xterm window (example), 484
hung window or process in a window, killing, 482
jobs, killing by job number, 438
-KILL or -9 option, 470
killall -i, 476
killing all processes, 473
killing processes by name, 474
-l option, signals for, 722
%num, 436
pid, 436
process ID-1 and, 473
restarting daemons, 471-473
-STOP $$, 455
stopping jobs on overloaded system, 443
unkillable processes, 479
user ID and, 453
zap script, using, 477
kill key, 105
KILL signal, 468, 470
killall command, -i (interactive) option, 476
ksh (Korn shell), 10, 513
alias command, 520
aliases, 571, 574, 575
arrays, 195
expanding ranges, 196
bgnice option, 482
command history (see history of commands)
command-line arguments in shell scripts, 725
command-line editing, 613
completion features, 549
dynamic prompts, simulating, 72
ENV variable, 706
environment variables, 707
fc -l command, listing previous commands with, 598
FPATH search path for shell functions, 588
globbing (wildcard expansion), preventing, 660
history file, 606
ignoreeof variable, 90
job control commands, 436
limiting file size, 280
logging out of, 90
logout, running commands at, 90
parsing strings, using set and IFS, 766
passing command history to, 608
.profile file, 47
prompt, setting, 71
prompts
nonprinting characters in, 80
reading arguments, 526
read-only functions, 585
redirecting standard I/O, 887
scripts in this book, 516
shell functions for pushd and popd commands, 624
special characters/operators in, 536-539
string editing operators, 748
terminal port type, putting into ttykind shell variable, 58
ulimit -c command, removing limits on core dumps, 281
wildcards, failing to match, 662
L[ Top ]
la function, 581
lambda statement (Python), 872
lambda statements (Python)
as function arguments, 873
last access time for files, 156
deleting files by, 274
last line of a file (ed and sed), referring to with $, 639
last modification time for files, 168
(see also timestamps)
last operator (Perl), 853
lastcomm command, 504
piping output or redirecting to a file, 505
LATEX, 928
Layer 3 Internet Protocol (IP), 936
Layer 4 protocols, 936, 937
lc operator, 846
LDAP server for system passwords, 956
leave function, 81
length command (awk), 385
lensort script, 429
less command
highlighting matched patterns, 261
zless, for compressed files, 283
less program, 9, 236-??, 236, ??-237
-N option, numbering lines with, 246
PAGER environment variable, 706
piping ls command output to, 157
piping to, 889
-s option for squashing extra blank lines, 241
less than (<) operator, 762, 846
less than or equal to (<=) operator, 847
lesskey program, 237
letters, ASCII class for, 110
letter-sized pages, 922
lexical analyzer (lex), 306
lf function, 581
/lib directory, 823
libraries
Perl modules
using in scripts, 844
shell functions, 738
licenses
Citrix, 963
Microsoft, in a WTS environment, 963
lightweight varieties of Unix, 6
limit and ulimit system calls, 280
line #: ;; unexpected error, 776
line command, 755
line commands in vi, 331
line editors (see batch editing)
line function, 723
line numbers
resetting, 776
in sed addresses, 672
line termination characters (see newlines)
line termination in Python, 871
line-by-line and search using sed, awk, or perl, 256
linefeeds (Unix), ASCII character for, 11
lines
addressing for batch editing, 369
comparing for uniqueness, 418
counting with wc command, 303
deleting duplicate
Perl script, using, 430
deleting duplicates, 427
deleting in Emacs, 354
joining with join command, 417
macro for wrapping in vi editor, 350
numbering in file printout, 246
sorting by length, 429
LINES and COLUMNS environment variables, 59
resizing/resetting for windows, 100
lines of text retained by scrollbar, 109
Lingua::EN::NameParse Perl module, 431
link count, 206
linking files, 201, 203-212
creating and removing links, 208
directories, linking, 210
directory, links to, 207
filenames for symbolic links, showing, 212
hard links, 205
hard links vs. symbolic links, 206
reasons for, 203-205
symbolic links, 205
stale, 209
linkname, ln command and, 208
links
copying, 215
disk space and, 279
to .exrc files, 312
to filenames, 737, 748
to files
inodes and, 263
hard links
finding to files, 197
-links operator (find command), 176
optimizing disk space with, 279
to programs, 737, 748
tar -l command, printing messages about hard links, 285
unlinking in Perl, 856
Linux, 3, 6
adding users to system, 984
automount daemons and devfsd for removable media, 907
backups to a local device, 790-795
compression, advantages/disadvantages of, 794
deciding what to back up, 791
floppies or zip disks, 794
tape, 792
utilities for, 795
bash shell, 10
color names, displaying with GNU ls command, 158
Debian Linux
apt-get tool, 832-834
dselect tool for accessing dpkg installation package, 825-832
kernel boot output for devices, 901
single-user mode, 985
devices on PCIbus, showing, 901
disk partitions, 904
displaying latest entries from kernel ring buffer, 242
enabling gatewaying, 949
groups, changing primary with newgrp, 987
HOWTO for kernel configuration, 903
HOWTO for serial consoles, 912
HZ constant for system time updates, 781
ifconfig file output, 939
info command, 38
installing software with RPM, 838
IP masquerading, 949
ipconfig and route files (2.4 kernels), 940
listing all processes running on, 14
loadkeys command, 105, 124
system-level changes to key mappings, 126
mounting SMB drives onto their local filesystems with smbmnt, 952
netstart, displaying routing information with, 940
nvi-1.79 editor, locking files before editing, 773
OpenSSH, 1012
port, testing for, 57
/proc filesystem, 979
Python, inclusion of, 869
Red Hat and Debian, shortcut to creating periodic processes, 492-494
Red Hat Linux
adduser (or useradd) utility, 984
/contrib directory, sshd.pam file, 1015
Filesystem Hierarchy Standard (FHS), support of, 823
installing chroot with anonftp-* (RPM), 944
performance issues, shell as interpreter, 744
/proc filesystem (in Version 6.2), 463-468
single user mode, accessing, 985
route command, 940
security, web site information on, 971
signal 15 (termination), 439
sound card configuration, 912
TCP wrappers, 981
USB devices on, 911
virtual consoles, 83, 447
switching between, 92
tty-type, scrolling, and copy and paste operations, 448
virtual machine running Windows, 962
LISP programming language
Emacs customization, 357
lists, 849
references to, 852
ln command, 208
-s option, 209
-s option, 208
lndir program, 211
load averages, system, 506
-load option (xrdb), 139
loadkeys command, 124
local command, 583
local crontab entries, 494
local dictionary files, 295
local programs, 210
LOCAL_OPTIONS option (zsh), 586
locate command, 174, 187
database for, 190
shell wildcards, matching, 189
updating database for, 188
lockfiles, creating, 772-774
locking files (RCS), 815
log command (awk), 386
log files
CVS, 819
CVS, examining for conflicting changes, 821
disk space and, 279
global alias for in zsh, 576
monitoring with tail -f, 245
smb.conf, settings for, 953
$LOGDIR environment variable, 51
LOGDIR environment variable, 629, 706
log-file-monitoring programs
tail -f, 243
logging in, 452
changing login sequence, 54-60
logging out
background processes in Bourne shells, avoiding termination of, 441
by killing user's login shell, 471
logging (xterm), elimination for security reasons, 114
logical expressions, evaluating, 183
logical operators, 763
login command, 709
.login file, 46, 48
interactive C shells and, 52
SHLVL variable, resetting, 83
TERM environment variable, testing, 55
terminal type, setting with qterm, 97
login shells, 43, 48, 61
bash, 47
C shell, setting up, 46
command search table, resetting for scripts, 699
killing, 471
Korn shell, 47
setup files, 48
setup files, contents of, 49
SHELL environment variable, 706
xterm or rxvt, running on, 107
zsh shell, setting up, 47
login(l) command, system-wide setup, 45
logins
disabling, 993
external root login access, 990
interactive
starting remote X clients from, 141
procedure for terminals (non-network), 452
remote
stopping sessions, 449
root, 79
shells disallowing, 44
terminal hangs during, 100
loginsh variable (tcsh shell), 48
loginshell variable, setting, 48
LOGNAME environment variable, 706
logout command (C shell), 708
.logout file
reading when last top-level shell exits, 52
running commands when logging out, 89
.logout file (C shell), 46
logout files, creating for Bourne and Korn shells, 90
logouts
accidental, from Bourne shells, 90
bash shell, 47
long listing (-l option), 156
long listing, ls -l command, 165
look command, 259, 299
-df options, 299
lookfor shell script, 193
loopback mounts, 907
loops, 12
alias definition, 578
basename and dirname used with, 752
controlling with break and continue, 623, 730
endless, 771
exit status of, 753
for loops in Bourne-type shells, repeating commands with, 556
foreach loops, repeating commands with variations, 554
if-then-else, putting in C shell aliases, 579
iterating through arrays, 849
parameters for, 556
in Perl scripts, 852-854
flow-control operators, 853
redirected input/output, line numbers reset in, 776
running command and testing exit status, 719
in shell functions, 581
loosely typed language, 845
lp command, 916
LPDEST environment variable, 706
lpc commands, 917
exit, 918
help, 918
restart, 918
status, 916
lpd daemon, 923
filter scripts, 932
running files through filter, 924
LPDEST environment variable, 706
lpq command, 472
lpr command, 915
for loop, using with, 560
PRINTER environment variable, 706
printing 10 file copies, shortcut for, 546
lprm command, 916
lpstat command, 916
lr alias, 162
ls command, 13
-- color option, 158
-A option, 163
filenames beginning with . (dot), 273
aa option, 163
aliases for, 163
-C option, 165
-F option with, 164
-la (for ls -a or -A), 164
ll (for ls -l), 165
lr, 162
-b option
listing filenames with nonASCII characters, 271
printing octal values of nonprinting characters, 166
-c option, 156
-C option (output in columns), 157
color, displaying names in, 158-161
-G option, 161
-d option (listing directories), 157
-F (tcsh built-in), 158, 159
filenames and, 20
find command, using with, 174
GNU, 161
-i option, 263
-il option, 180
-l option, 156, 263
character count for files, 304
checking startup files for ownership, 101
file permissions and, 188
file permissions, listing, 995, 1006
listing files by last modification time, 168
-lai option, 206
-lg option, 1007
piping output to wc command, 303
-q option
converting nonprinting characters to ?, 166
nonASCII characters, 271
-Q (quoting) option, 165
-R option (listing subdirectories), 157
-s option, 185
shell functions with options, 581
System V Unix, nonprinting characters and, 166
-t option, 155
-u option, 156
-ls flag (for login shell), 107
-ls operator (find command), 184
LS_COLORS environment variable, 159, 707
setting with dircolors command, 159
LSCOLORS environment variable, 161
lt operator (Perl), 846
LyX editor, 929
M[ Top ]
m command, marking place in vi editor, 334
m (ending escape sequence), 158
-m (map) option (tset command), 95
MAC (Ethernet) address, 948
Mac OS X, 3
Darwin, 6
downloading and installing One-Step, 836
enabling root access to, 993
passwords, storing, 11
SSH on, 1011
swap space, checking contents of /var/vm with ls, 976
Terminal application, 44
color capabilities, 79
command-k to delete scrollback buffer, 89
user and group management through Netinfo, 984
Macintosh
carriage returns in text files, translating to newlines, 406
keyboards, CTRL and CAPS LOCK, 125
Microsoft Word file, converting for Unix, 11
macros
Emacs, 356
troff -man, 65
magic-space tcsh editor function, 612
mail, 944
directory for, 152
Emacs facility, 357
headers, removing with behead script, 395
permissions for files, 996
SMTP (Simple Message Transfer Protocol), 944
mail exchanger (MX) records, 941, 945
stored by DNS, 946
mail program, 28
\ (backslash) before history characters, 616
redirecting input for, 885
redirecting standard error to, 889
sending yourself email copy of fortune, 772
shortcut for multiple addresses, 546
Mail User Agents (MUAs or UAs), 945
mailboxes, disk space and, 279
mailto utility, 408
Main Options menu (xterm), 113
make utility, 230-233
configuring source code, 841
installing Samba, 952
make clean command, 825
make distclean command, 825
software installation problems with differing versions, 824
makealias command, 580
Makefile.in (configure file), 825
Makefiles (or makefiles), 231-233
for NIS, 232
for Perl, 841
makewhatis utility, 33
man command, 32
command-line options, 32
-man macros (troff), 65
MANPATH environment variable, 33, 707
adding, 66
manual pages
formatted with nroff commands, 927
locating for a program, 33
MANPATH environment variable, 707
Perl
perldata manpage for variable interpolation, 845
on Unix system, 844
searching, 34
for shell prompts, 71
types of, 35
map( ) function, 872
map commands, vi, 336-340
arrow key mappings in text-input mode, disadvantages of, 339
command mode maps, 337
text-input mode maps, 338
| (vertical bar), quoting in, 344
arrow keys, mapping, 339
disabling temporarily, 339
(see also keymaps, vi)
mappings, keyboard events at server level (see keysym mappings)
mark command, 630
markup languages, 928
master password file, 25
master word list, ispell program, 301
match command (awk), 386
matching (see grep commands; pattern matching; regular expressions)
max log size directive (smb.conf), 953
-maxdepth operator (find command), 272
maximum file size, setting in shells, 280
memory
information about from meminfo file, 463
virtual memory statistics, checking, 977
menu completion, 551
menu prompts, 79
menus
xterm, 113-114
-merge option (xrdb), 137
merging files
in CVS, 820
in RCS, 817
Message Transfer Agents (MTAs), 944
MX records, use of, 946
META key in Emacs (see ESC-x in Emacs)
metacharacters
. (dot)
csplit search patterns, escaping in, 403
display by cat -v command, 238
displayed by od -c, 239
in regular expressions
^ and $ anchor characters, 638
, 536, 636, 637
. (dot), matching any character with, 640
examples of use, 650
Perl, 854
search and replace commands for sed or ex, 655
valid metacharacters for different Unix programs, 651
shell, 636
in shells, 536
wildcard pattern matching in case statements, 714
in X event translations, 132
Metaframe (Citrix), 963, 964
Metamail utilities, 408
methods, 844
Python, 873
Microsoft
licensing, strictness of, 963
security, 971
Windows (see Windows)
Word (Macintosh) file, converting to Unix, 11
MIME encoding, 408-410
mimencode utility, 408
minus sign (see - (dash), under Symbols)
MIT (Massachusetts Institute of Technology), 30
mkdir (2) system call, adding directories and their hard links, 207
mkdir command, 152, 187
history substitution, 153
-m option, 153
-p (parents) option, 153
mkfifo command, 897
/mnt directory, 823
modem input, written with send, 568
modem output, reading by expect, 568
modems, 900, 909
personal LAN over, gatewaying from, 950
testing with Expect program, 570
modems, checking for stalled data connections, 102
modes
access permissions after chmod, 1000
editing modes in Emacs, 356
for directories, 148
xterm menus, setting with, 114
modification times for files, 154
csh alias to list recently changed, 162
finding files by, 168
listing newest file, 169
-mtime operator (find command), 175
sorting files by (ls -t), 155
modifiers for patterns, 856
modifiers (in regular expressions), 637
mod_python module, 876, 879
modules
kernel, for device drivers, 900
PAM (Pluggable Authentication Modules), 1015
Perl
Audio::SoundFile, 842
CPAN (Comprehensive Perl Archive Network), 431
use module statement in scripts, 844
Python, 869, 874
cgi, 878
checking your version for, 870
htmllib and HTMLParser, 876, 878
mod_python, 879
urllib, 876
urllib2, 876, 877
modulus (%) operator, 762
month order, sorting in, 428
more command
case-insensitive searches, faking, 258
more program, 236-237
PAGER environment variable, 706
piping to, 889
-s option for squashing extra blank lines, 241
sed output, displaying, 671
starting, 454
MOTD, security and, 978
mount command, 900
loop option, 907
mounting
Network File System, 908
mounting filesystems, 905, 906
Network File System, 101
mouse
copy and past in tty-type virtual terminals with, 448
Emacs editors, not having to use in, 355
mouse for xterms, 107
move command (ex), 371
moving blocks of text delimited by patterns, 317
moving files and directories, 201
between filesystems, 203
file, moving into another directory, 202
moving text with vi editor, 313
Mozilla browser, closing window by killing its processes, 485
mt command, 793
MTAs (see Message Transfer Agents)
-mtime operator (find command), 175, 178
mtr (Matt's traceroute), 942
MUAs (Mail User Agents), 945
multiline commands
secondary prompts and, 559
sed editor, 670
multiline quoting, Bourne shell, 530-531
multiline replacement strings, sed editor, 677
multiline shell prompts, 76
multiple-line patterns, grep using sed, 255
Multipurpose Internet Mail Extensions (see MIME encoding)
munchlist script, 302
mutliprocessing on Unix, 435
mv command, 202
-f option, 1002
file ownership and, 998
-i option, 213
modifying file without write permission, 1004
renaming files, 165
renaming groups of files and, 212
mx function, 581
M-x in Emacs (see ESC-x in Emacs)
MX (see mail exchanger record)
my operator (Perl variable declaration), 844
N[ Top ]
n or N (next) commands, sed editor, 690
-name operator (find command), 176, 249
using with -exec, 183
-name operator (find command)
-print operator, combining with, 184
-name option, effect on resources, 135
named buffers, transferring text among with vi editor, 313
named pipes (FIFOs), 897
named.conf file, 947
names
of applications and resources, 135
computers on network, 36
Domain Name Service (DNS), 945-947
of programs, in error messages, 736
SMB peers (NETBIOS), 954
usernames, 983
nameservers (NS), 941
namesort script, 430
namespaces in Python, 874
naming
commands, 736
environment variables, 704
files, 150
shell scripts, 736
NAT (see Network Address Translation)
natd daemon, 949
navigating Unix filesystem, 617-632
automatic directory setup, 630
cd, speeding up with aliases, 627
changing directories, 622
changing directories with c (shell function), 627
current directory, 620
finding, 621
finding (anyone's) home directory, 629
loop control, break and continue, 623
marking your place with shell variable, 630
relative and absolute pathnames, 618
shell pushd and popd commands, 624-626
navigation icons for resources shared with SMB network, 956
nawk utility, 379
awk variables, support of, 382
examples, 760
version history, 388
ndown (network down) script, 486
ndown script, 564
ne (inequality) operator, 846
neatening text (see editing; fmt command)
negative numbers as variable values, 778
nested command substitution, 768
nested loops, breaking or continuing, 624, 730
nesting
` ` (backquotes), 562
NETBIOS name, 954
Netinfo, Mac OS X user/group management with, 984
Netinfo, storing MacOS X passwords, 11
netpbm package, 933
netscape -remote technique, 574
netstat command, 940, 976
Network Address Translation (NAT), 937, 948
for PPP connections, 950
private addresses, 948
network cards, kernel boot output for, 900
network devices
configuring with ifconfig, 908
network devices, configuring, 900
Network File System (see NFS)
Network Information Service (NIS), 11
network interfaces for gateways, 948
network time synchronization, 781
networking language (SMB on Windows), 951
networking utilities, 28
networks
archiving files for, 808
checking connections for security breaches, 976
computers, names of, 36
configuration of network devices (ifconfig file), 939
diagnosing problems with ping and traceroute, 941
printing over, 923
CUPS package, 933
starting and disabling for dialup connections, 564
(see also connectivity)
newer alias (printing newest filename), 169
-newer operator (find command), 179
newgrp command, 987, 998
newlines
as argument separators, 527
awk procedures, separating, 381
in Bourne shell quoting, 532
different characters for, 27
DOS, converting to Unix, 822
Mac vs. Unix, 11
\n
in bash shell prompt, 77
in Bourne-type shells, 77
in event translation tables, 132
quoted in sed, shell interpretation of, 697
in sed multiline replacement strings, 686-688
in sed replacement, 676
translating Mac carriage returns to, 406
in vi @-functions, 342
news
Emacs facility for, 357
removing headers with behead script, 395
next command (awk), 386
next (n or N) commands, sed editor, 685, 690
next operator (Perl), 853
nextdir command, 195
NFS (Network File System), 30
directories, backups to remote tape drive, 797
directories remotely mounted by, hung terminals and, 101
find command, preventing from searching, 200
installing packages residing on server, 827
mounting, 908
NFS (Network File Systems)
file recovery, vi -r command vs., 324
nice command, 506-510
background processes and, 441
BSD Unix
C shell, 508
standalone, 508
foreground jobs and, 510
renice command, 443, 507, 510
System V
standalone, 509
nice numbers, 507, 510
BSD C shell nice, 508
BSD standalone nice, 508
System V C shell nice, 509
System V standalone nice, 509
niceness, 507
System V, C shell nice, 509
NIS (Network Information Service), 11
nl program (line-numbering), 246
n>&m operator
echo commands ending with, 722
examples, 769
redirecting standard output and standard error, 756-759
nmbd daemon, 952
nobody (generic user for HTTP web pages), 975
noclobber shell variable, 267, 892
noglob option, 660
nohup command, 445
background processes, avoiding termination of, 441
disown vs., 447
nohup.out file, 445
nom script, 666
trap command in, 722
non-ASCII characters in filenames, deleting files with, 271
noninteractive shells, 49
nonlogin files
bash, 47
nonlogin shells
Bourne shell, .profile file and, 46
startup files, 48
xterm, configuring for, 108
nonprintable characters
displaying with od -c command, 239
nonprintable characters in filenames, 166
"nonprintable" or "control" characters, 9
nonprinting characters
erasing with sed to eliminate extra blank lines, 242
filenames with, file deletion and, 273
ls command, System V Unix, 166
octal values of, printing with ls -b, 166
showing with cat -v, 237
nonprinting escape sequences in a prompt, 80
non-rewinding tape devices, 792
noremap command (vi), 350
not a tty message, 460
not equal to (!=) operator, 846
NOT operator, 177
not operator, 847
NOT operator (!), 381
NOT operator (!), using with find command, 179
notification of changed job state, 444
notification of job-state changes, 436
-nouser or -nogroup operators (find command), 186
nroff program, 927
commands in, 35
formatting text with sed, 392
-man macros, 65
NT domains, 951
NUL characters, 238, 899
delimiters, using as, 180
null command, 717
null or unset variables, errors caused by, 778
numbering lines, 246
numbers
ASCII class for, 110
numeric exit status, 455
numeric mode (chmod), 1000
numeric operators, 846
numeric sorting, alphabetic vs., 426
numeric tests, syntax errors in, 777
nup (network up) script, 486
nup script, 564
O[ Top ]
object oriented programming (OOP) in Perl, 844
objects
file extension, 17
Python, 873
creating, 873
file objects, 875
resources in applications, association with, 128
objects, Perl, 844
releasing resources with close( ), 844
octal character strings, 80
octal number
permissions written as, 1000
octal numbers
permissions, writing as, 996
values of nonprinting characters, 166
od -c command, displalying nonprintable files, 237, 239
od -c command, dumping raw directory contets to screen, 202
od command
-c option, 271
offset script, 396
-ok operator (find command), 181
oldlinks script, 169
on-disk address of file data blocks, 262
One-Step (GNU-Darwin auto-installer for OS X), 836
online documentation (see info command; manual pages)
online manual source file extension, 17
open files
file descriptors and, 753
OpenSSH, 1012
Pluggable Authentication Modules (PAM), problems with, 1015
operating systems
BSD Unix, versions of make utility, 824
filename wildcards, 660
shells emulating operating systems, 661
graphical interfaces, 5
interoperability, 951
POSIX standard for interoprability, 6
operators
&&, 216
( ) (subshell) operator, 45
= (assignment) operator, 844
: (colon), string editing, 547-549
<< (here document) operator, 560
arithmetic, 762
array, 849
array-expanding, 196
awk utility, 382
Boolean, 847
in expressions, 635
precedence of, 635
for find command, 171-173
-exec, 179
-name, 175
search operators, 176-178
time (-mtime, -atime, and -ctime), 178, 179
find command
! and -name, 249
flow-control, for loops in Perl, 853
:gt operator (C shell), 85
if command, awk, 385
logical, 763
numerical, 846
parameter substitution (Bourne shell), 747
precedence of
Boolean operators in Perl, 848
redirect and append (>>), 317
relational, 762, 846
in shells, listing with definitions, 536-539
shift (Perl), 844
string, 74, 846
string editing, 748
unmatched, 776
/opt directory, 35, 823
optimizing disk space, 277-291
compressing a directory tree, 284
fine-tuning, 288
compressing files, 281-284
executable binaries, stripping, 289
limiting files sizes, 280
links, using, 279
quotas on disk usage, 290
opttest script, 731
or (-o) operator, case command, 770
OR operator, 177
| in extended regular expressions, 645
| (logical OR) operator, 763
agrep command, searching for multiple patterns, 252
evaluating OR expressions, 183
OR operator (||), 381, 564
or operator (|), 250
or operator (Boolean or), 847
orphans, 461
out-of-date links (see symbolic links, stale)
output (see input/output; standard output)
overriding event translations, 132
overwrite mode (Emacs), 360
overwriting files, 517
ownership, file, 263
changing with chown function in Perl, 856
changing without chown command, 1010
determining, 998
directory, setting sticky bit, 999
disk quotas and, 1009
groups, 986-988, 998
groups, determining for, 986
permissions, 994
remote files, scp -p command and, 1026
security and, 994
user, group, and world, 995
P[ Top ]
:p operator, 605
^^ history substitution, using with, 596
-p (parents) option (mkdir command), 153
p (print) command, sed editor, 689
packages
Python, 874
packed file extension, 17
packets, 936
packing files (see archives; compression)
page description languages, 929
consistency of, 930
page size for printing, 922
PAGER environment variable, 706
pager programs
more
displaying sed output, 671
pagers, 236-237
redirecting input/output to, 889-891
-s option to squash extra blank lines, 241
shell debugging output, piping to, 775
pagers, piping shell loop output to, 35
paircheck script, 305
paired item checking, 305
PalmOS
terminal emulators on, 93
PAM (Pluggable Authentication Modules), 1015
paragraphs, preserving with fmt, 391
parameter expansion
command-line argument quoting, errors caused by, 779
shortcuts, 780
parameter substitution
: (colon) used in, 746
: used in, 747
examples of, 747
parameters, command-line (see command-line arguments)
parent directory, 24, 202
creating, 153
links to, 207
listing in cdpath variable, 623
parent process, 454
PID for, 459
parent process ID (PPID), 480
parent-child relationships
environment variables and, 705
parsing
command-line, 520
command-line arguments, 730-732, 733, 734
HTML, Python module for, 876, 878
strings using sed editor, 767
strings with set command, 766
partitioning disks, 903
passmass script, 570
passwd command, 568
passwd file, 25
root password, resetting, 984
users, adding entry for, 982
passwords
access by attackers, 974
for VNC server, 960
empty
SSH server not allowing, 1015
groups, 998
local resources shared with SMB network, 953
root, forgetting, 984
Samba
clear text vs. encrypted, 955
for SMB server, 955
system file, 11
paste program, 416
pasting text
between vi's, 330
from window systems into vi, 343
in tty-type virtual consoles with the mouse, 448
pasting text in xterm windows, 110
between windows, 120-122
xclipboard, using, 117
patch program, 367, 377
context diffs, use of, 224
PATH environment variable, 587, 705, 708
command version, getting, 36
finding commands, 703
path shell variable and, 709
searching with #!, 744
shell functions, searching for, 587
path shell variable, 709
pathnames
absolute, 13
avoiding in archives, 813
tar utility, avoiding use with, 803
editing, 74
Emacs, PWD variable and, 363
filenames stripped from, 752
files archived on tape drives, 796
GNU tar backups to remote tape drive, 798
head of, returning with :h operator, 547
links to, 212
login shell, 706
matching with wildcard expressions in GNU tar, 801
relative
absolute vs., 618
(see also relative pathnames)
script, testing for, 748
in shell setup files, 51
stripped from filenames, 751
symbols in, 725
tail of, returning with :t operator, 548
wildcards in, 658
reasons not to use, 663
paths
changing in shell startup files, 519
echo $PATH command, finding directory pathnames, 149
local, sharing with SMB network, 953
in Perl scripts, 845
search paths, shells, 516, 518-520
(see also search path)
set path command, hung terminals and, 101
tail of each path in dirs output for C shell prompt, 85
in URIs, 833
pattern matching, 317, 633
in case statements, 770
compound searches with vi, 327
global commands useful with, 318-320
lowercase letters, 320
quick reference, 652-656
replacement patterns, 653
search and replace commands, 655
search patterns, 652
replacement patterns, 645
search patterns in vi editor, 314
global searches, 315
wildcards in case statements, 714
(see also regular expressions)
pattern space (sed editor), 680, 690
deleting contents with d command, 692
deleting portion of with D command, 692
edits across line boundaries, 685-688
pattern-expansion characters ({ }), 545-547
pattern-matching operators ~ and !~, 385
patterns, 633
aliases matching a wildcard-type pattern in zsh, 576
awk utility, 380
csplit program, for searches, 402-404
job control mechanism, use of, 439
matching in Expect program, 567
regular expressions vs. wildcards (file-matching patterns), 634
replacement, valid regular expression metacharacters for, 652
in sed, 688
(see also regular expressions; replacement patterns; search patterns)
pausing scripts, 489
pbm (portable bitmap) format, 933
pbmplus package, 933
PCL (Printer Command Language), 930
PCs
keyboard, CTRL and CAPS LOCK, 125
partitioning PC BIOS disk, 904
text files, removing carriage returns from, 406
Universal Serial Bus (USB), support of, 911
PDF, 930
pdksh (public domain Korn shell), 10, 513
aliases, 575
command-line editing, 613
FPATH environment variable for shell functions, 588
history file, 608
performance, 500-510
displaying running commands, 504
global and local problems, 501
problems with, checking for security breaches, 974-977
I/O statistics, 977
network connections, 976
processes, 974
swap space, 975
virtual memory statistics, 977
process scheduling at lower priority with nice, 506-510
system load, checking with uptime, 506
timing processes, 500-502
timing programs, 503
period (.) (see . (dot), under Symbols)
PERIOD shell variable, 87
periodic commands, 87
periodic execution of programs, 489-495
crontab entries, adding, 494
shortcuts to creating, 492-494
standard input, including in cron entry, 495
Perl, 839-868
branching and looping, 852-854
bug reports, filing, 841
commenting RCS files, 815
compiling, 841
configuration information, 840
configuring
Configure shell script, 841
CPAN, library modules on, 431
data types, 845-852
documentation
Plain Old Documentation (POD) system, 843
documentation (perldoc system), 839
fields, cutting, 411
File::Find module, 169
grep, simulating actions of, 248
installation, checking, 839
interpreter (perl), 839
line-by-line and search using, 256
modules
using in scripts, 844
offset script, 396
pattern matching (see regular expressions)
programming in Emacs, editing modes for, 356
Python vs., 880
regular expression syntax for ranges, 641
regular expressions, 854-856
documentation for, 653
scripts
anatomy of typical, 842
sl script, 212
sorting lines by length, 430
sorting names by surname, script for, 431
Text::Autoformat module, 393
Unix-like operators, 856
unlink( ) system call, using, 272
variables, 844, 845-852
arrays, 848
hash, 850
scalar, 845-848
versions, 840, 842
perl interpreter, 839
-perm operator (find command), 185
permissions, 994
changes, handling with aliases, 1002
changing with chmod, 1000
= operator, 1001
for executable files, 699
execute permission
without read permission, 1004
files managed by team of people, 996
finding files by, 185
fully accessible directory within unreadable directory, 1005
group, in directory with setgid bit, 985
groups that deny, 988, 996
group-write, 998
searching for and removing, 180
information neither personal nor modifiable, 996
lockfiles, 772-774
managing, 1006
modifying files without write access, 1003
octal number, writing as, 996
personal information, 996
read-only, 1002
remote directory backups and, 797
security and, 970
set incorrectly, 514
shell scripts, 1009
sticky bit, 999
umask command, 631, 997
personal directories, 150
personal word list, ispell program, 301
pg program
piping to, 889
pgm (graymap) format, 933
pick script, 477
pid (process ID)
killing jobs by, 436
pid (process IDs), 438
PID (see process ID)
Pike, Rob, 477
ping program, 941
pipelines
exit status of, 716
starting with cat command, 888
pipes, 9
buffering output, 894
commands joined with, 698
copying directory trees, 216
find output to xargs ls -l, 184
locate command output to xargs, 188
ls command output, 157
ps command in, 459
redirecting input/output, 886, 887
|& operator, 891
named pipes (FIFOs), 897
to pagers, 889-891
tpipe command, 896
redirecting standard error (but not standard output), 888
pixmaps, 934
pkg_add utility, 837
Plan 9 operating system, 10
Pluggable Authentication Modules (PAM), 1015
plus sign (see +, under Symbols)
pnm graphic format, 934
pointers
to other files or directories (see symbolic links)
PTR record for IP address, 941
for screen navigation, 107
Point-to-Point Protocol (PPP)
configuring connection for gatewaying, 950
setting up dialup session, 910
pop operator (Perl), 849
popd command, 77, 84, 624-626
clearing directory stack with, 626
portable bitmap format, 934
Portable Bitmap Package, 933-935
portable graymap format, 934
portable pixmap formats, 934
ports
firewalls and, 949
HTTP requests, 949
IP addresses and, 937
numbers for, 938
port forwarding, problems with, 1028
SMTP requests, 949
terminal, listing of types, 58
testing port (tty) numbers for terminal setup, 57
well-known, database in /etc/services, 938
POSIX (Portable Operating System Interface), 6
Post Office Protocol (POP or POP3), 945
postfix program, 945
PostScript
converting text files to, 930
page description language, 930
source file extension (.ps), 18
text files, converting to, 922
ppm (pixmap) format, 934
pr command, 411-413, 920-922
-h (heading) option, 412
-l option (page length), 413
-m option (one file per column), 412
-number option for columns, 412
sX option (setting column separator to x), 412
-t and -n options, 246
precedence of operators, 635
Boolean operators in Perl, 848
predefined environment variables, 705-707
preprompt commands, 87
setting, 88
previous job, 439
primary groups, 986
primary partitions, 904
print command (awk), 386
print function, 848
-print operator (find command), 197
-name operator, using with, 184
printcap file, 923
apsfilter, installing, 932
printenv command, 465, 704, 712
checking for environment changes at different systems, 57
Printer Command Language (PCL), 930
PRINTER environment variable, 706
printer queue, watching for errors (watchq script), 472
PRINT_EXIT_VALUE option (zsh), 716
printexitvalue shell variable (tcsh), 716
printf command (awk), 386, 397
printing, 914-935
commands without executing them (:p operator), 548, 605
Common Unix Printing System (CUPS), 933
files, shortcut for, 546
formatting plain text with enscript, 922
formatting plain text with pr, 920-922
languages for, 929
converting text files into, 930
converting typeset files into, 931
lpc commands, 917
lpr-style commands, 915
lp-style commands, 916
markup languages, formatting with, 928
network, 923
Portable Bitmap Package, 933-935
printers, configuring to share with SMB network, 956
over Samba, 923, 958
from Unix to Windows printer, 924
to Unix printers, 924
spooling system
converting source files, 932
lp and lpr, 915
spooling system for, 914
symbolic links, using, 919
typesetting, 925
manpages with nroff commands, 927
Unix hitory of, 926
using different printers, 918
priocntl command, 507
priority of processes, 506-510
changing with renice command, 510
Unix definition of, 507
priority ordering for processes, 441
stopped jobs and, 443
private addresses, 948
private directories, 150
private keys (see public-key cryptography)
/proc filesystem, 463-468
hardware, 466
memory information, 463
security checks using, 979
/stat file (statistics on the kernel and system), 464
statistics by PID, 465
statistics on current process, 464
procedural programming languages, functions in, 872
procedures (awk utility), 381
process groups, 453
priority of processes in, modifying, 510
signals sent from keyboard, 470
process ID (PID), 87, 453, 480
-1, 473
kill command, feeding to, 470
statistics of process by, 465
unique filenames, use in, 170
zmore script (example), 721
process substitution, 542
in nom script example, 667
tee command, using with, 896
processes
background (see background processes)
background and foreground, 435
chain leading to your window, 480-482
checking for security breaches, 974
cleaning up unkillable, 479
closing a window by killing its processes, 484-487
shell script, using, 486
web browser (example), 485
xterm window (example), 484
commands printed in parentheses by ps, 462
controlling process, 454
controlling terminal, 459
creating new with fork and exec calls, 452
defined, 437
destroying with kill command, 470
disowning, 446
exit status of, 715
exit status returned by, 455
foreground
(see foreground processes)
interactively killing those matching a pattern, 476
killing all, 473
killing by name, 474
killing interactively
zap script, using, 477
listing with ps command, 14, 456
managing, overview of, 453-455
open files for reading from/writing to, 754
parent-child relationships, 705
priority, lowering with nice command, 506-510
/proc filesystem, 463-468
hardware information, 466
statistics by PID, 465
queue by priority, 441
restarting daemon shell script with kill command, 471-473
scheduling, 488
at command, running once with, 489
regular, periodic execution with cron, 488
signals and, 468-470
actions in response to signals, 469
kill-9 command, sending KILL and STOP signals, 469
spawning, 452
stopped vs. terminated, 439
stopping, 478
terminal windows without shells, 482
timing, 500-502
tracking down with ps command, 460-462
-a option, on BSD systems, 461
-a option, on System V, 460
-ax option on BSD, 462
-e option, on System V, 462
runaway processes, 462
Unix handling of, 437
unrelated, communicating through FIFOs, 897
.profile file, 45
bash shell, 47
Bourne shells
testing TERM variable with case statement, 56
CDPATH variable in, 623
hung terminal and, 101
Korn shells, 47
login shells, 48
stty commands in, 105
terminal type, setting with qterm, 97
profiler (GNU gprof), 501
programming
Unix (see also shell scripts)
programming languages
Emacs as IDE for, 356
functions in, 872
loosely typed, 845
Tcl, 567
programming, shell (see shell scripts)
programming, Unix, 5
programs
aborting, 103
bin directory for, 149
environment, modifying, 737
file deletion, 265
filename wildcards, passing to without shell interpretation, 661
filters, 9
links to, 748
names of
giving multiple names with links, 737
in error messages, 736
periodic execution with cron, 489-495
crontab entries, adding, 494
shortcuts to creating, 492-494
standard input, including in cron entry, 495
redirecting input and output of, 753
shells running, 515
timing, 503
Unix, 6-9
as tools, 8
(see also shells)
waiting for input, 102
prompt shell variable, 49, 70
if (! $?prompt) exit test, 53
setting to see aliases hidden in the ($?prompt) test, 53
PROMPT_COMMAND (bash shell variable), 88
promptpid variable, 87
prompts, 70-89, 515
$ (dollar sign), in Bourne shell prompts, 516
blank, 83
Bourne-type shells, primary, 706
characters displayed in different sehlls, 11
C-shell, stray prompt problems, 73
current directory in, using dirs command output, 84
dynamic, 71
simulating, 72
external commands sending signals to set variables, 86
faster setting with built-ins, 74
highlighting and color in, 79
history number in, 594, 598
menu prompt for naive users, 79
modified, script program and, 783
multiline, 76
preprompt commands, setting, 88
preprompt, preexecution and periodic commands, 87
PS1, PS2 variables, 706
right-side, 81
secondary
> as, 556
? as, 555
Bourne shell quoting and, 530
multiline commands and, 559
session info in window title or status line, 77
static, 70
subshell level, showing, 82
typing commands at, 454
propagating shell functions, 586-591
exporting bash functions, 586
FPATH search path, 587-591
Korn shell, 588
zsh shell, 590
protocols
curl application, support of, 836
URI types, 832
wget utility, support of, 834
(see also individual protocol names)
-prune operator (file command)
quick finds in current directory, 199
-prune operator (find command), 198
-prune operator (find command), 272
preventing networked filesystem searches, 200
ps command, 456, 460-462
-a (all) option
BSD-derived systems, 461
System V, 460
-ag options, displaying all processes on system, 477
AIX version of, 459
aux options (Berkeley style), 457
aux options (Berkeley-style), 15
aux or -ef options, listing chain of processes, 481
-ax option, 462
checking current processes for security breaches, 974
checking for application running on remote display, 143
commands printed in parentheses, 462
displaying programs, 103
-e (everything) option, 462
-ef options (System V), 458
-el options, 15
grep, using with, 249
listing of command output fields, 457
in pipes, 459
runaway shell script, locating, 475
showing all jobs with -x or -e options, 446
x option, 14
zombies, listing, 470
PS1 environment variable, 70, 706
PS2 environment variable, 707
pseudo-terminal, 459
pstat utility, 975
psychotherapist program, Emacs, 366
ptbk script (for incremental backups), 799
pty, 459
public directive (smb.conf), 953
public key cryptography
authentication, not working on SSH, 1018
installing key file on remote host, 1017
passphrase, problems with, 1018
SSL, use of, 943
public-domain version of Korn shell (see pdksh)
punctuation in filenames, 16
push operator (Perl), 849
pushd command, 77, 84, 85, 624-626
aliases for, 626
pushing or pulling information, 488
put command
copying files to remote host from Unix, 959
restoring text with vi editor, 313
pwd command, 211, 621
PWD environment variable, 706
storing in prompt to give current directory, 72
unsetting before using Emacs, 363
Python, 869-881
installation, 869
Disutils program and, 870
modules, checking for, 870
overview of language, 871-875
functions, 872
GUIs, 875
indentation, 871
I/O and formatting, 875
modules and packages, 874
objects, 873
Perl vs., 880
portability of, 869
web, interacting with, 876
cgi module, 878
htmllib and HTMLParser modules, 878
mod_python module, 879
urllib module, 876
urllib2 module, 877
Q[ Top ]
:q (quote) string modifier (C shell), 197
:q (string editing) operator, 548
qmail program, 945
qterm program, 55, 97
+usrtab option, 98
.qtermtab file, 98
editing, 99
-query option (xrdb), 137
querying terminal type (qterm), 97
queues
printing jobs, 915, 918
processes by priority, 441
quieting at jobs, 496
quit command
ex, 371
sed, 696
quit key, 105
QUIT signal, 468, 469
ignoring in System V with nohup command, 445
killing processes waiting for NFS resources, 471
quota command, 291
quota systems for disk usage, 290
quote command, 580
quoting
aliases, 572-574
C shell, 580
fixing in csh with makealias and quote, 580
in Bourne shell, 526-531
multiline, 530-531
rules for, 527-529
special characters, 527
in C shell, 531-534, 779
rules for, 532-533
special characters, 531, 533
in case statement wildcard pattern matching, 714
command-line arguments, 734
errors caused by, 779
control characters in Emacs, 364
filename arguments containing wildcards, 801
hereis document terminators, 761
preventing wildcard expansion with, 660
quote characters from Windows, formatting for Unix, 120
regular expression special characters to prevent shell expansion of, 634
regular expressions used with grep or egrep, 654
in shells
\ (backslashes), 540
here documents, 534
showing with verbose and echo settings, 533
special characters and their meanings, 536-539
showing results with showargs, 518
special characters in key bindings, 612
QWERTY keyboards, 125, 126
qx( ) function, 856
R[ Top ]
rand command (awk), 387
random numbers in nawk (srand), 387
ranges
.. (integer-range) operator in zsh, 546
character ranges (hyphen-separated), 404
character ranges in regular expressions, 405, 640
expanding, 196
Perl regular expression syntax for, 641
rc shell, 10
rcp command, 30
-r option, 214
RCS (Revision Control System), 815-818
archiving files, 814
ci (checkin) command, 815
co (checkout command)
-p option, sending file to standard output, 816
comparing directory with subdirectory, using pr, 412
Emacs support for, 356
file utility, recognizing archives with, 240
listing revision numbers with rcsrevs script, 817
merging two or more file versions with rcsmerge and co -j, 817
searching files with rcsgrep commands, 252-254
unlocking files, 816
rcsdiff command, 221, 818
rcsegrep.fast script, 253
rcsgrep command, 248, 252-254
-a option, 817
rcsgrep script, 253
RD (Receive Data) light, 102
rdesktop (RDP client for Unix), 965
read command, 557
ex editor, 371
reading from the keyboard, 723
while loops using, 750
read permission
changing with chmod, 1000
for directories, 149, 995
execute permission without, 1004
finding files by, 185
shell scripts, 1009
reading files, access time and, 155
reading from terminals
process groups and, 453
reading-tar process, 216
readline command, 105
Readline library
inputrc file, 614
setup filename, choosing, 707
read-only files, 1002
read-only functions, 585
recomment script, 394
recovering files
cpio tape archive, 805
Emacs, using, 358
vi -r command, 324
recovered buffers, cautions about, 325
recursion, tracing depth of, 584
recursive aliases, 578
recursive functions, 583-585
recursive permission changing, 1001
recursive searching with grep, 182
Red Hat Linux (see Linux)
redirect operator (>>), 317
redirecting input and output, 885-899
C shell, 891
cat command, 888
commands combined with grouping (( )) operator, 893
cron system output, 489
to /dev/null, 898
FIFOs, using, 897
line numbers in redirected loops, 776
to multiple processes, 895
noclobber, using, 892
openstandard I/O files without, 754
pagers, piping to, 889-891
of programs, 753
shell capabilities, 755
shell output and errors into temporary file, 776
standard error (only), piping, 888
standard input and standard output, using, 885-888
standard output and standard error, 756-759
Bourne shells, 526
standard output, shell processing of, 517
tee program, 894
redo operator (Perl), 854
references (Perl), 844, 851
dereferencing, 852
reformatting text from one window before pasting it into another, 120
registry settings for clear text SMB passwords, 955
regular expressions, 248, 633-656
agrep command, 251, 252
awk utility, 380
egrep command, 194, 250
examples of, 650
expr command
matching parts of strings, 765
testing character strings, 764
expressions, understanding, 635
extended, 645
alternation mechanism, 645
filename-matching patterns vs., 634
finding lines that don't match a pattern, 249
globally substituting for each match, 385
interpreting, 636
limiting extent of match, 649
matching a character with a character set, 639
matching specific number of sets with \{ \}, 642
matching words with \< \>, 643
metacharacters, 536, 636, 637
for different Unix programs, 651
pattern context, 646
pattern matching, quick reference, 652-656
replacement patterns, 653
search and replace commands, 655
search patterns, 652, 654
Perl, 854-856
metacharacters in, 854
potential problem areas, 644
range of characters, specifying with [-], 640
repeated patterns, matching with \(\), 644
repeating character sets with *, 641
retrieving only matched text with xgrep script, 648
sed editor, 258
addresses, 672, 673
delimiting, 675
searching for patterns split across lines, 690-692
sequence of characters, describing, 635
showmatch script, testing with, 648
simple vs. extended, 637
substituting for matches in nawk, 388
tar archive files, matching filenames of, 800
wildcards vs., 634
(see also pattern matching)
rehash command, 150, 520
resetting command search table, 699
relational operators, 762, 846
if command, awk, 385
relative pathnames, 24, 618
creating, 619
current directory and, 620
links, avoiding invalidation of, 209
in shell setup files, 51
symbolic links to, 212
remainder, modulus (%) operator, 762
remote access
conrolling (see ssh)
disallowing for security, 980
rsh (see rsh)
remote clients, starting for X window systems, 140-143
Remote Desktop Protocol (RDP), 963
client for Unix (rdesktop), 965
remote directories, hung terminals and, 101
remote files
Emacs, opening with, 357
shortcut for copying, 546
remote logins
status line updates, 78
stopping sessions, 449
remote restoration of backup files, 797
remote shells
setup files for, 52
(see also rsh; ssh)
remote tape drive, tar backups to, 797, 798
-remove option (xrdb), 138
removing
command-line arguments, 726
software packages, dependency conflicts caused by, 830
removing files, 262-276
confirmation before deletion, 265
deleting directories, 272
deleting files with odd names, 269-276
eight-bit filenames, 271
filenames starting with - (dash), 271
i-numbers, using, 272
directory sticky bit permission and, 999
emptying files instead of, 277
excluding some files from, 275
find command and, 276
interactively, with file-deletion script or alias, 266
rm command
dangers of, 263
-f option (no confirmation), 269
safety techniques for, 265
safe delete program, 268
safer file deletion in some directories, 267
selective deletion of, 266
stale files, deleting, 274
rename function, 856
renaming files
directory sticky bit permission and, 999
groups of, 201, 212
interactively, 213
mv command, using, 165
with nonprinting characters in names, 166
ownership and, 998
write access and, 1004
renice command, 443, 507, 510
rep command, vis command vs., 559
repeat command, 554
. (dot), in vi, 313
clearing directory stack with popd, 626
repeating commands, 554, 593
at set intervals, 558
copy and paste, using, 557
cycle of commands, 604
with history substitution, 599-604
with variations, 554-557
for loop, using, 556
foreach loop, using, 554
replacement patterns
sed editor, delimiting, 675
special characters in, 653
valid regular expression metacharacters for, 652
replacements, 372
confirming in vi editor, 315
global, with vi editor, 315
patterns, matching for, 319
sed editor
newlines in, 676
referencing portions of search string in, 678
referencing the search string in, 677
specifying one match among many possible matches, 679
(see also substitution commands)
repositories, CVS archives, 818
modifications, commiting and pushing into, 819
setting up, 820
reprint character (CTRL-r), 543
requote shell script, 120
fmt width option, 121
resize command, 59
-c or -u options to force use of C- or Bourne-shell syntax, 100
xterm windows, 99
RESOURCE_MANAGER property, 138
resources
overloaded, 443
removing definitions, 138
setting for X Window System, 128-130, 133-140
appres (application resource) utility, 139
event translations, overview, 130-133
-name, effect on resources, 135
querying resource database, 137
resource database manager, 129
resources file (example), 134
xrdb utility, using, 136-139
-xrm command-line option, 135
setting for X Window system
resource database manager, 133
restart command (lpc), 918
restoring files
RCS, using, 816
from remote tape drives, 797
from tape with tar, 795
(see also backups; tar utility)
restricted command access (rsh) shell, 513
restricted shell, 142
RETURN characters (in .exrc file for vi editor), 335
return command
awk utility, 387
shell function, use in, 583
reverse order, command history listed in, 598
reversing patch, 378
reversing sort order, 428
revision control programs
file versions and, 17
revision control (see CVS; RCS)
Revision Control System (see RCS)
revnum shell variable, 817
rftp script, 570
.rhosts file, 122, 142, 797
Rich Site Summary files, collecting, 488
right-side prompts, 81
rlogin utility, 141
disabling for security reasons, 980
enabling on Mac OS X, 1011
logging in to host again from same terminal, 50
network ports for, 57
stalled connection with, 103
rm command, 263
excluding files from deletion, 275
-f option, 269, 722, 1002
filenames beginning with - (dash), 271
filenames beginning with . (dot), 273
-i option, 271
confirmation of deletions, 265
creating -i file for, 267
linked files, deleting, 206
links, removing, 209
-r option, 273
-rf option, 272
safety techniques for, 265
rmdir (remove directory) command, 272
rmstar variable (tcsh shell), 265
root access
enabling in Darwin, 992
logins, 79
logins, external, 990
password, forgetting, 984
providing with sudo application, 991
root directory, 23
subdirectories located directly off, 822
root of a filename (:r string editing operator), 547
root servers (DNS), 946
rot program, 419
route command, 940
routers
DSL, firewalls, 950
functioning as gateways, 948
routing
diagnosing routes with traceroute, 942
packets, preventing with firewalls, 949
routing tables, displaying with netstart -r, 940
RPM, finding and installing packaged software, 838
rprnt key, 105
rsh, 29, 513
disabling for security reasons, 980
-display option, 143
enabling on Mac OS X, 1011
-n option, 143
remote tape drive, accessing with GNU tar, 798
restoring files from remote tape drives, 797
rsync program, 374
running reading- or writing-tar on remote system, 217
starting remote X clients, 142
stopping sessions, 449
rsync command, 374, 489
runaway processes, 462
killing by name, 474
run-parts script, 493
runsed script, 671
rusers command, 733
rxvt terminal program, 106
fonts and command-line options, 116
login shell, running, 107
S[ Top ]
\s (matching whitespace characters) in Perl regular expressions, 855
"safe delete" program, 268
safer rm command, techniques for, 265
Samba
connecting to SMB shares from Unix, 959
installing and configuring, 951
configuration script for daemons (smb.conf), 952
NETBIOS names (SMB peer names), 954
running SMB daemons, 954
mounting SMB-shared filesystems, 909
printing over, 923
from Windows to Unix printers, 924
to Windows printer from Unix, 924
project web site, 952
security, 955
security settings in smb.conf, 955
swat tool, 956
sash shell, 513
save lines (-sl option) for xterms, 109
SAVEHIST environment variable, 606
savehist shell variable, 606
saveLines (xterm resource), 109
saving command lines to file, 12
-sb option (scrollbar) for xterms, 108
/sbin directory, 823
scalar variables in Perl, 844, 845-848
Boolean operators used with, 847
comparing with relational operators, 846
numerical operators used with, 846
string operators used with, 846
sched command, 81
scheduler program, 500
process priority, lowering with nice, 506
scheduling processes, 488
at command, running once with, 489
regular, periodic execution with cron, 488
scientific notation, 427
scp command, 30, 944
copying archives, 799
problems and solutions on SSH, 1013, 1025
screen editors, 93
screens, 710
clearing, 89
script program, 75, 782
cleaning files, 783
ending, 782
scripting languages, 27
Perl (see Perl)
Python (see Python)
shell scripts vs., 700
scripts
#! notation on first line, 516
turning on verbose and echo settings, 534
batch editing, 367-389
writing, 368
bin directory for, 149
buildhash, 302
CGI, Python module for, 878
cgrep, 255, 690-692
checksed, 671
cleanup, 276
converting characters in files, 12
count.it, 304
dialback, 568
editing, 390-420
behead script, removing mail/news headers, 395
centering lines, 397
columns, making automatically with column, 413
cutting columns or fields, 410
encoding binary files into ASCII, 406-410
fmt.sh, 392
indenting text with offset script, 396
joining lines with join, 417
pasting data into columns, 416
rotating text with rot, 419
splitting files by context, 401-404
straightening, 415
text conversion with dd, 410
text in columns with pr, 411-413
translating characters with tr, 404-406
uniq command, 418
Expect program, 570
file permissions, changing, 1002
cx and cw scripts, 1003
file-deletion, 266
file-time comparisons in, 156
hgrep, 260
lensort, 429
lookfor shell script, 193
munchlist, 302
namesort, 430
ndown and nup, 564
nom, 666
opttest, 731
paircheck, 305
pausing, 489
Perl (see Perl)
ptbk, 799
rcsegrep.fast, 253
rcsrevs, 817
running without the shell, 743
run-parts, 493
runsed, 671
sed editor
hold space, using, 681-683
order of commands, 674
shell script wrappers for, 724
shell (see shell scripts)
shells reading from standard input, 759
showargs, 518
showmatch, 648
smbprint, 924
sourceable, 576-578
SUID and SGID, 989
unconnected symbolic links, finding, 169
updatedb or locate.updatedb shell script, 190
vgrep, 665
writeway.pl, 842
writing in other scripting languages, 700
ww.sh, 305
xgrep, 648
xwrist, 771
script.tidy script, 783
SCROLL LOCK button, 102
scrollbars (xterm), 108, 109
scrolling error messages, 890
scrolling in tty-type virtual consoles, 448
SD (Send Data) light, 102
sdiff command, 224
building one file from two compared files, 225
-w option, 225
search access to directories, 149, 997
search and replace
regular expressions used in sed or ex, 655
undoing in vi editor, 315
(see also replacement patterns; search patterns)
search operators with find command, 176-178
search path, 13, 516, 699
configuring in shell setup files, 49
in .cshrc.$HOST file, 60
FPATH (for functions), 587-591
Korn shell, 588
zsh shell, 590
PATH environment variable, 705
setting for shells, 518-520
updating with rehash, 150
search patterns
csplit program, 402-404
for ed, ex, and sed, regular expression metacharacters in, 652
global commands with, 318-320
regular expressions in (examples), 654
sed editor
delimiting, 675
split across lines, 690-692
vi editor, 314
compund searches, 327
global searches, 315
search permission, 995
(see also execute permission)
search strings in sed, referencing portions of in replacement, 678
search wraps, stopping in vi, 320
search.el file, 362
searching
for doubled word typing errors, 305
in Emacs, 362
PWD variable and, 363
grep commands, using, 247-261
look program, using, 259
manual pages, 34
secondary prompts
> (greater than sign) as, 556
? (question mark) as, 555
Bourne shell quoting and, 530
multiline commands and, 559
sections in documentation, 32
secure keyboard mode (xterm), 114
Secure Shell (SSH) (see ssh)
Secure Sockets Layer (see SSL)
security, 969-981
bin directory, preventing unauthorized file operations, 150
buffer overflow, 972
CERT checklists, 970
disallowing rlogin and rsh, 980
files, 994
making them unwritable, 1002
managing permissions, 1006
modifying files without write access, 1003
sticky bit permission, 999
(see also permissions)
host listings in .rhosts file or /etc/hosts.equiv file, 142
inetd daemon, disabling, 979
intruder detection, 977
keeping up with security alerts, 971
Linux /proc filesystem, viewing current state of system, 979
login program, checks performed by, 43
MOTD, importance of, 978
NFS and, 909
performance problems, checking, 974-977
I/O statistics, 977
network connections, 976
processes, 974
swap space, 975
virtual memory statistics, 977
Samba, 955
security settings in smb.conf, 955
TCP wrapper programs, checking logs, 980
vulnerabilities, 969
xterm, 114
sed editor, 56, 367, 668-697
addressing, 672-674
command line, 669
commands, operations of (deliberate scrivener analogy), 688-690
dedent script, 121
delete commands, 672, 692
delimiting regular expressions, 675
-e option, 670
edit non-matching lines, 693
extra blank lines, squashing, 242
-f option, 670, 744
files, not changing by editing, 669
fmt.sh script, 392
general-purpose batch editing, 373
global commands, 669
grep program, multiline context, 255
grep programs, 248
hold (h or H) commands, 681
hold space, 680, 680-683
line-by-line and search using, 256
line-numbering with, 246
lq command, 169
makealias and quote aliases, 581
mkdir command, inserting into find command output, 187
multiple matches on a line, 679
-n option, 670, 689, 768
newlines in a replacement, 676
newlines quoting and backslashes, shell interpretation of, 697
order of commands in a script, 674
parsing strings, 767
pattern space, 680
making edits across line boundaries, 685-688
print (p) command, 689
quit (q) command, 696
referencing portions of a search string, 678
referencing the search string in a replacement, 677
regular expressions used in
documentation for, 653
metacharacters, 652
search and replace commands, 655
searching for patterns split across lines, 690-692
substitute command, 783
test (t) command, 695
testing and using a script, 670
checksed script, 671
runsed script, 671
transformation on text, 680
using from command line, 559
wrapping sed scripts in shell scripts, 725
writing scripts, 675
x (exchange) command, 681
y (transform) command, 683-685
SEGV (segmentation violation) signal, 468
selecting text in xterms, 109
word selection, changing word definition for, 110
xclipboard, problems with large selections, 119
selection of fonts, enabling for xterm, 116
send command, 568
sendmail program, 409, 945
Server Message Block File System (SMBFS), 908
server number (X Window System), 710
servers
access control, 141
anonymous FTP, 944
Apache, running Python in, 876, 879
DHCP, 948
DNS, 946
IMAP, 945
NAT (Network Address Translation), 948
POP, 945
SSH
empty passwords, problems with, 1015
SSH, problems with, 1021-1029
VNC (Virtual Network Computing), 959
services
/etc/services file, 938
inetd file, managing Internet services, 942
SMB, verifying, 954
Session Message Block (SMB) protocol, 951
sessions, information about in window title or status line, 77
set command, 733
+H option, disabling history substitution in bash, 616
listing shell variables, 712
listing shell variables and functions, 704
lockfiles, creating, 773
multiple variables in for loop, 751
with no arguments, 734
opttest script (example), 731
parsing single-line strings with, 766
window size, 59
-x option, turning on echo flag, 534
-xv option, 775
-xv option
hung terminals and, 101
set directory command, 333
set noglob command, 96
set notify command, 436
set path command, 101
setgid bit, group permissions for directory, 985
setprompt alias, 85
setprompt function, 75
setstatline alias, 78
settitle alias, 78
setup files for shells (see configuration files)
setup files (multiple) for vi and ex, 321
SGID bit for directories, 149
SGID scripts, 989
SGML, 929
sh (Bourne shell), 9, 10, 453, 513
#!, seraching the PATH with, 744
aliases, 571, 574
arrays, 195
at command output, quieting, 496
background processing, 438, 440
-c option, 483
case statements, 54
port name, testing, 57
testing TERM variable, 56
date formats, 86
debugging scripts, 775-784
for loop, 556
hangups in, 445
loading changed PATH, 519
logouts
accidental, 90
running commands at, 90
multiline commands, 559
piping output of shell loops to pagers, 35
.profile file, 45
prompts, 71
primary prompt, 706
quoting in, 212, 526-531
multiline, 530-531
rules for, 527-529
showing with verbose and echo settings, 534
special characters, 527
reading arguments, 526
reading .profile file, 101
redirecting standard I/O
standard error, 889
redirecting standard I/O (see redirecting input and output)
repeating commands, 554
safe delete program, 268
script file extension, 18
scripts, writing, 698-740, 741-774
(see also shell scripts)
simulated shell functions and aliases, 591
special characters/operators in, 536-539
string editing operators, 748
su stucklogin command, 100
TERM variable, setting with tset command, 96
trap command, 86, 469
wildcards, failing to match, 662
sh command, 103
starting Bourne shell with, 516
-v option, 213
-xv options, 775
.sh filename extension, 18
sharing
desktops with VNC, 959-962
directories and printers with Windows network (see Samba)
sharing directories and printers with Windows network
printing over Samba, 923
shebang line in scripts, #! characters, 843
SHELL environment variable, 706
resize command and, 100
shell escapes, 326
starting a subshell, 456
shell functions, 13, 523, 581-592
c, changing directories with, 627
C shell, determining whether to use, 524
custom commands in, 571
functions calling functions, 583-585
listing, 704
loops in, 581
ls with options, 581
propagating, 586-591
exporting bash functions, 586
FPATH search path, 587-591
putting arguments inside a Bourne-type alias, 575
simulating with . (dot) command, 737
specific shells, information on, 585
using in shell scripts, 738-740
work, setting current shell environment, 582
ww function, finding doubled words, 305
shell metacharacters (see wildcards)
shell parameters, with simulated functions, 592
shell prompts (see prompts)
shell scripts, 11, 455, 698-740, 741-774
:, #, and #!, 742
: (Bourne shell) operator, 746
#!, searching the PATH with, 744
arguments passed to, 12
basename and dirname, using, 751
bin directory for, 149
bkedit, 717
case statements, 713-715
pattern matching in, 714
testing string values with, 713
closing window from, 486
command lines as scripts, 698
command-line arguments, handling, 725-729
commenting, 743
commenting RCS files, 815
conditional expressions in if statements, 716-718
dater, 898
debugging, 775-784
environment variables, 702-711
exec command, 745
exit status of Unix processes, 715-720
loops, testing with, 719
testing with if statement, 716-718
exit status, setting, 720
exits caused by interrupts, trapping, 721
expr command, 762-764
finding last command-line argument, 749
for loop with multiple variables, 750
with GNU tar, archiving deleted files on tape, 274
hardcoding users' home directory pathnames, 629
interactive use vs, 515
last-access times, 156
limitations of, 577
lockfiles, creating from, 772-774
lookfor, 193
making executable, 1003
multiple names for, 748
naming, 736
nested command substitution, 768
for noninteractive shells, 49
parameter substitution, 747
parent-child relationships, 705
Perl, using (see Perl)
permissions, 699, 1009
reading from standard input, 760
regular expressions metacharacters in, 536
requote, 120
runaway, killing by name, 474
running, 743
running as a daemon, 472
scripts without the shell, 743
scripts written in other scripting languages vs, 700
shell functions, using in, 738-740
shell functions vs., 582
shell reading script from standard input, 759
shell variables, 711-713
showenv, 465
simple, examples of, 698
sourceable, 576-578
sourcing, 577, 737
standard input to a for loop, 750
strings, working with, 764-768
stripper, 290
submitting for execution at a later time, 495
testing character strings with expr, 764
testing for success, 718
testing two strings with a case statement, 770
turning off echo, 761
variables set by, 777
while loop with several loop control commands, 753
wrappers for awk, sed and other scripts, 724
writing simple, 698
zap, 477
shell variables, 711-713
$ (dollar sign), preceding name with, 713
cdable_vars, 630
cdpath, 622
in .cshrc.$HOST file, 61
current directory, storing in, 630
environment variables vs., 703, 711
eval command and, 521
histchars, 615
history, 712
IFS (internal field separator), 766
iterating over arguments, 779
listing with set command, 704, 712
multiline quoting in Bourne shell and, 530
names, 711
noclobber, 892
path, 709
printexitvalue, 716
printing value of individual with echo, 713
read-only, 712
revnum, 817
savehist (C shell), 606
set by shell scripts, debugging, 777
setting, 711
setting with combined use of sed and eval, 768
storing control characters in, 783
shell wrappers
invoking sed scripts from, 670
sed script embedded in, 691
shells, 7
aliases, 571-581
archives, filename extension, 18
arrays, 194-197
expanding ranges, 196
built-in commands, 8, 13
command argument lists, providing, 173
command-line editing, 594, 609-615
calculating prompt string width, 80
commands for working with functions, 585
as controlling process, 454
curly braces ({ }) in, 20, 661
debugging (see debugging)
defined, 515
determining which is running, 11
disowning jobs, 446
Emacs, running in, 353, 355
exiting to close a window, 482
filename-matching patterns, 634
history mechanism (see history of commands)
interactive, 48
interpretation of commands (see commands)
interpreting the command line, 7
job control (see job control)
kill command, built-in, 479
killing, 471
limiting file sizes, 280
metacharacters in, 536
passing command history to, 608
priority, setting with nice, 507
as processes, 453
programming, 11
(see also shell scripts)
pushd and popd commands, 624-626
quoting in (see quoting)
reading scripts from standard input, 759, 760
redirecting standard I/O (see redirecting input and output)
relationship with kernel, utilities, and applications, 8
remote login sessions, stopping, 449
remote, running, 142
replacing one with another, using exec, 745
replacing with exec command, 452
running scripts without, 743
setting up, 43-69
account setup, changing, 50
contents of setup files, 49
.cshrc.$HOST file for per host setup, 60
interactive shells, 49
login shells, 48, 61
logins, 43
Mac OS X Terminal application, 44
reading setup files at different times, 51
setup files, understanding, 44-47
terminals, automatic setups for, 54-60
setup files, 13
PATH environemt variable, 705
special characters and their meanings, 536-539
specialized, based on languages such as Python, TCL, Perl, 513
stopping jobs on, 443
subshells, 455
suspending with suspend command, 436
terminal windows without, 482
types of, 9, 515
understanding # as comment, 744
Unix programs working independently of, 9
-v (verbose) option, 760
wildcards, 657-667
handling of, 660-662
matching with fast find commands, 189
(see also wildcards)
without job control, using 0 (zero) PID to kill all processes, 474
X window, using from, 480-482
shift command, 195
removing command-line arguments, 726
unsetting command-line parameters, 749
in while loops, 728, 729
shift operator (Perl), 844, 849
.sh_logout file, 91
SHLVL variable, 48
shorthand substitution command (^xy^yx), 602
.shosts file, 143
showargs script, 518
showenv shell script, 465
showmatch script, 648
shutdown program, 16
side-by-side file comparisons (sdiff command), 224
Sierra, Mike, 77
signals, 468-470
common, listing of, 468
distribution of, using process groups, 453
handling, 469
kill command, using with, 470
killing all processes, 473
killing processes by name, 474
killing processes interactively, 476
restarting daemon shell script, 471-473
STOP signal, 478
unkillable processes, 479
numbers, variations among systems, 468
for trap commands, 721, 722
simulating dynamic prompts, 72
sin command (awk), 387
single quotes (see ', under Symbols)
single user mode, 984
site-packages directory, 870
size
finding files by, 168
fonts, 112, 116
limits for files, 784
xterm windows, 99
-size operator (find command), 185
-sl option (save lines) for xterms, 109
sl script, 212
sleep command, 489
endless while loop, using in, 771
forcing shell to wait before exiting, 90
in strings of commands separated by semicolons (;), 564
uses of, 498
sleeping, 15
slocate command, 187, 190
SMB (Session Message Block) protocol, 951
smbclient program, 954, 959
connecting to SMB printer, 958
smb.conf files, 952
default printer, sharing with SMB network, 958
defaults, leaving in place, 953
security directive, 955
sharing local directory with SMB network, 953
smbd daemon, 952
SMBFS (Servr Message Block File System), 908
smbfs tool, 909
smbmnt command, 952
smbpasswd utility, 956
smbprint script, 924
SMTP (Simple Message Transfer Protocol), 944
sockets
displaying active with netstart, 940
returning activity on with netstat, 976
Secure Sockets Layer (see SSL)
soft disk quota limits, 290
soft links (see symbolic links)
soft mounting of NFS, 101
software installation, 822-838
challenges of, 824
curl application, using, 836
Debian apt-get tool, using, 832-834
configuring sources.list file, 832
Debian dselect tool, using, 825-832
access method, choosing, 826-828
choosing packages for installation or removal, 828-830
configuring packages, 831
exiting, 832
exiting select function, 830
installing packages, 831
removing packages, 831
updating information on available packages, 828
FreeBSD packages, using, 837
FreeBSD Ports, using, 837
GNU wget utility, using, 834-836
make utility, versions of, 824
RPM, using, 838
simplifying the make process, 824
/usr/bin and other directories for, 822
software robots, 488
Solaris
adding users to system, 984
disk device naming scheme, 904
OpenSSH, 1012
serial consoles, 913
single user mode, entering, 985
vold daemon for removable media, 907
sort command
alphabetic vs. numeric, 426
-b option (ignoring blanks), 427, 428
case-insensitive sorts, 428
-d option (dictionary order), 428
fields, 422
-g option, sorting numbers in scientific notation, 427
-M option (month order), 428
-r option (reverse order), 428
-t option, changing sort field delimiter, 424
-u option, 299
-u option, eliminating duplicate lines, 427
sorting
files, 155
by last name (namesort script), 430
lines by length (lensort script), 429
sort command, 422-429
sound cards, 900, 911
source code, locating for programs, 33
source command
ex editor, 372
-h (history) option, 609
reading aliases file into C shell, 46
scripts, using on, 577
shell scripts, using on, 737
source filename, 579
sourceable scripts, 576-578
sources.list file, 827
components, 833
configuring, 832
distribution, 833
spawning processes, 452
special characters
in Bourne shell (sh), 527
C shell, 531
C shell filenames, quotiing in, 533
in filenames, 17, 166
deleting files, 269-272
in shell prompts, 71, 74
in shells and regular expressions, 634
in shells, listing with definitions, 536-539
spell checking, 295-302
aspell utility, 297
ispell program, 296
-a option, 298, 302
adding words to dictionary, 301
-d option, providing master spelling list, 302
look command, 259, 299
sed editor, corrector program, 695
spell command, 295, 298, 299-301
-b option (British usage), 300
dictionary files for special words and terms, 295
spellhist file, 301
spellprog program, 300
stop list for typical misspellings, 300
-v option, 300
-x option, 300
split command
awk, 387
loops using, 752
variants of, 399
split function, 383
splitting strings
IFS, places in which it can't be used, 767
into fields, 766
SPOOL (Simultaneous Printing Off and On Line), 914
spooling system for printing, 914
converting source files within, 932
lpd daemon, 923
lpr-style commands, 915
symbolic links, 919
spreadsheet modes in Emacs, 357
sprintf command (awk), 387
sqrt command (awk), 387
srand command (nawk), 387
ssh, 29, 1011-1029
-agent option, copying archives without password, 799
backups to remote tape drive, 797
accessing with GNU tar, 798
differences from rsh, 143
enabling on Mac OS X, 1011
interactive login, 141
-keygen option, 943
OpenSSH, 1012
port numbers for, 57
problems and solutions, 1013-1029
general and authentication, 1013-1019
key and agent problems, 1019-1021
server and client problems, 1021-1029
protecting access through, 1011
rsync program, 374
running reading- or writing-tar on remote system, 217
scp file copy mechanism, 944
stalled data connection with, 103
starting remote X clients, 142
suspending jobs, 449
sshd daemon, 943
mail checking, disabling, 1013
.pam file, 1015
printing, disabling for, 1013
problems with, 1021
SSL (Secure Sockets Layer), 943
Python support for, 876
stacks
directory, 624-626
function parameter buffers, overflowing, 972
stale files, deleting, 274
stale symbolic links, 209
stalled data connections, 102
standard error, 754, 885
combining with stdout and piping to pagers, 891
grep command output, 890
for interactive and noninteractive shells, 49
redirecting, 756-759
( ) subshell operators, using, 893
Bourne and C shells, 887
Bourne-type shells, 526
in C shell, 891
to a pipe, 888
shell debugging output, piping to pager, 775
sys.stderr file object (Python), 875
writing debugging messages to, 584
writing to via /dev/stderr, 888
standard input, 9, 754
compressing/uncompressing files from, 283
to a for loop, 750
including directly on cron command line, 495
reading scripts from, 760
redirecting, 885-888
( ) subshell operators, using, 893
tee program, using, 894
shell handling of, 517
shells reading scripts from, 759, 760
sys.stdin file object (Python), 875
standard output, 9, 754
combining with stderr and piping to pagers, 891
compressing/uncompressing files from, 283
for interactive and noninteractive shells, 49
normal and debugging, splitting into two files, 776
printing terminal type output for tset command, 96
RCS file, sending to, 816
redirected to a file, 755
redirecting, 756-759, 885-888
( ) subshell operators, using, 893
Bourne-type shells, 526
in C shell, 891
piping to pager program, 890
to /dev/null file, 899
to multiple processes, 895
shell debugging, piping to pager, 775
shell handling of, 517
sys.stdout file object (Python), 875
starting anchor (^) in regular expressions, 638
startup command for vi and ex editors, 312
startup files for shells, changing path in, 519
statements in Python lambdas, 873
static IP addresses, 937
static prompts, 70
statistics
current process, 464
kernel and system (/proc/stat file), 464
processes by PID, 465
status
command execution, in nawk, 388
exit status of Unix processes, 715
returning to calling shell, 583
status command (lpc), 918
status file, information on current process, 466
status lines, session info in, 77
stderr (see standard error)
stdin (see standard input)
stdout (see standard output)
stem-derivative rules for spelling words, 300
sticky bit, 999
stop command, 436, 443
stop list, spelling, 300
STOP signal, 468
stopping out of control processes, 478
stopped jobs
continuing in background, 436
current job and, 442
listing with their job numbers, 436
putting into foreground, 436
termination vs., 439
stopping
jobs, 443
remote login sessions, 449
stream editor (see sed editor)
string concatenation (.) operator, 846
string operators, 74
strings, 635
building with { }, 545-547
comparing for pattern matching, 635
editing with : (colon) operators, 547-549
grabbing parts of, 764-768
echo, using with awk or cut, 765
matching with expr, 765
parsing using sed editor, 767
parsing with set and IFS, 766
matching a regular expression, finding with grep, 248
Perl, 845
operators for, 846
Python, 875
substr command, awk, 388
testing, 735
case statement, using, 770
characters with expr, 764
errors in syntax, 778
for zero length, 739
strings utility, 239, 259
strip command, 289
stripper script, 290
stty command, 58
control keys, setting, 105
data rate for dialup terminals, 97
erase, kill, and interrupt characters, 105
finding out terminal settings with, 104
-g option
parsing output using set and IFS, 766
stty tostop command, 436, 444
su command
account changes, testing, 51
starting a subshell, 456
su -f stucklogin, 100
su stucklogin, 100
substituting identify with, 990
sub command (awk), 388
subdirectories
listing with ls -R, 157
root, in FHS standard, 822
searching for in directories with find command, 173
subprocesses, 454
aliases and, 572
file descriptors given to, 755
killing parent processes by name, 475
subroutines
dot (.) command compared to, 737
in Perl, 844
user defined, 845
subshells, 455
( ) operators, 45, 893, 895
CSHRC_READ environment variable, setting for, 53
environment variables, inheritance of, 46
levels, showing in prompt, 82
setting command-line arguments, 734
startup files, 48
status line updates, 78
umask command, running in, 773
substitution commands
delimiting search pattern from replacement string, 675
ex editor, 372
gsub command in nawk, 385
history substitution, using in, 603
sed editor
-g (global) flag, 669
newlines in a replacement, 676
referencing portions of a search string in the replacement, 678
script.tidy using in, 783
specifying one match among many possibilities, 679
sub command, nawk, 388
substitutions, confirming in vi editor, 315
substr command (awk), 388
success or failure of commands, indication in exit status, 715
sudo application, 991
SUID scripts, 989
SunOS
groups, 998
redirecting standard I/O, 887
superuser
configuring, paths set by parent process and, 519
file ownership, changing, 998
killing others' processes, 471
private directories, access to, 150
shell prompt for, 79
sudo application, 991
tcsh and zsh shell prompts, 72
UID and GID of zero, 983
susp key, 105
suspend command, 436, 455
suspending
background jobs with stop command, 436
current foreground job with CTRL-z command, 436, 438
swap space, checking for security breaches, 975
swapinfo utility, 976
swat tool, 956
configuring smb.conf file installation, 952
printers, selecting for sharing, 958
symbolic links, 205
copying, 215
directories, linking, 210
disk space and, 280
filenames for, showing, 212
files as, 164
finding for every directory owned by a group, 180
finding unconnected, 169
finding with find -type command, 184
hard links vs., 206
saving disk space wiwth, 279
spooling, using for, 919
stale, 208, 209
syntax of, 206
to /dev/null
replacing log files with, 279
to .enter and .exit files, 631
symbolic mode (chmod), 1000
symbols
in filenames and pathnames, 725
for keys on the keyboard (keysyms), 124
(see also special characters; Symbols section)
symlinks (see symbolic links)
sync program, 16
synchronizing
filesystems (rsync program), 374
time on networks, 781
"Syntax error" error message, 777
syntax-checking program, 306
sys.stderr file object (Python), 875
sys.stdin file object (Python), 875
sys.stdout file object (Python), 875
system
cron jobs, running on, 489
environment variables for shells, 45
C shells, 46
load, checking with uptime, 506
overloaded with background processes, 441, 443
password file contents, 11
performance and profiling, 500-510
security vulnerabilities, 969
statistics on (/proc/stat file), 464
time, 503
system calls, 7
exec and fork, 452
fork and exec, 514
limit and ulimit (limiting file sizes), 280
unlink( ), in Perl, 272
system command (nawk), 388
system function, 856
System V
command version, getting, 32
<defunct> status, 470
echo command, shell quoting and, 540
groups, 987
groups (Release 4), 998
ls command, nonprinting characters and, 166
nice command, 509
printing commands, 916
priority system (Release 4), 507
ps command
-a option, 460
-e option, 462
-ef options, 458
signals, 468
systems derived from, rsh on, 143
tr command
character ranges in, 405
-cs options, 307
piping ww function output to, 305
system variables (awk), 382
system word file, 299
system-level key mappings, 126
T[ Top ]
t (test) command, sed editor, 695
table of contents, tar files, 809, 812
tables
column -t command, 414
creating with nroff and sed, 393
tabs
as argument separators, 527
filenames ending in, 165
TAB characters
added by diff command, 225
displaying with cat -t and -e options, 238
stripping in Bourne shell, 535
window systems running vi, 343
TAB key, file completion and, 553
tail command, 242-245
-c option (count characters) or -b option (count blocks), 243
-f option, 466, 891
log file, monitoring with, 776
monitoring file growth, 243
GNU version
- -follow option, 245
- -follow=name and - -retry options, 245
-l (lines) option, 243
-n option, 243
-r (reverse) option, 243
comparison with rot command, 420
tail of a path name
dirs output for C shell prompt, 85
:t operator, 548
talk utility, 30, 37
tape, backups to, 792
cpio program, 805
remote tape drives
using GNU tar, 798
using tar, 797
restoring files with tar, 795
remote restoring, 797
tar utility
absolute pathnames, avoiding, 803
backing up to tape, 792
compression, arguments for and against, 794
copying directory trees, 216
disk space optimization and, 284
encoding tarfiles into 7-bit, 407
filename extensions, 18
filename wildcards and, 661
functions, 809
GNU tar command
-c and -T options, 274
features of, 813
making backups, 788
online archives, creating, 808
remote tape drive, using for backups, 797
restoring files from tape, 795
remote restoring, 797
restoring a few files, 796
tar command
-c (create) option, 790
-C option, 216
command-line arguments, order of, 804
extracting all files from archive, 286
extracting some files from archive, 286
-f (file) option, 790
-I option to run bzip2, 285
-l option (for links), 285
options, 809-813
-t option, 796
-t or -tv options, listing files in archive, 285
-v (verbose) option, 216, 790
-z option to run gzip, 285
unpacking archives, 595, 888
wildcards, using, 800-803
with GNU tar, 801-803
Tcl, 567
tclsh shell, 10
TCP, 936
wrapper programs, 980
tcpd daemon, 980
tcpdump program, 942
TCP/IP
IP addresses and ports
addresses, 937
SMB traffic, mapping onto, 951
TCP, UDP, and ICMP, 937
tcp_wrappers package, 942
tcsh shell, 10, 453, 513, 515
{ } (pattern-expansion characters), building strings with, 545
> in the prompt, 11
aliases, 571
with command-line arguments, 572-574
command history, 593
command-line editing, 611-613
completion features, 549
command-specific, 551
configuration files, 47
current directory, updating in status line, 77
cwdcmd alias for status line updates, 79
exit status of previous command, 715
highlighting in, 81
history file, 607
timestamp-comments in, 608
history (see history of commands)
limiting file size, 280
loginsh variable, 48
ls -F built-in command, 158, 164
LS_COLORS environment variable, 159
pre-prompt commands, 87
printexitvalue shell variable, 716
prompt, setting, 71
quotation marks around filenames, 212
right-side prompts, 81
rmstar variable, confirming file deletions, 265
set echo verbose command, 101
special characters/operators, 536-539
stop command, 443
su -f stucklogin command, 100
wildcards, 662, 704
window name, setting and testing, 59
(see also C shell)
.tcshrc file
multiline prompt showing directory stack, 84
set echo verbose command, 101
shlvl shell variable, 82
.tcshrc files, 47
tee program, 894
collecting output of several commands into one file, 895
process substitution, using with, 896
Tek Options menu (xterm), 113
teletype, 7
telnet utility, 29
enabling on Mac OS X, 1011
logging in to host again from same terminal, 50
stalled connection with, 103
suspending jobs, 449
temporary files
filenames ending with ~, 629
handling text with, 563
history numbers, using to locate and remove, 598
redirecting output to, 775
swap space on hard disk, 975
traps, using to clean up, 721
unique filename generation for, 170
vi editor, running out of space for, 332
TERM environment variable, 55, 94, 706
setting with tset command, 96
testing with case statement, 713
TERM (terminate) signal, 439, 468, 471
ignoring with nohup command, 445
kill command, using with, 470
killall command, sending with, 476
termcap database, 80, 94
termcap entries, 338
TERMCAP environment variable, 96, 706
resetting with resize command, 100
terminal driver, eating backslashes before special characters, 540
terminal emulators, 30, 93
terminal settings and, 106
(see also xterm)
Terminal program (Mac OS X)
color capabilities, 79
command-k to delete scrollback buffer, 89
terminal type
setting in shell setup files, 49
terminals
automatic setup
environment variables, testing, 57
terminal table, searching, 58
testing port (tty) numbers, 57
testing remote hostname and X display, 56
testing window size, 58
window name, setting and testing, 59
automatic setups, 54-60
capabilities of (see termcap database)
configuring, 92-123
erase, kill, and interrupt characters, 104
finding terminal settings with stty command, 104
querying terminal type with qterm, 97
size of xterm windows, 99
terminal hangs at login, fixing, 100-104
terminal type, setting, 95
xterm, 106-123
controlling terminal, 459
/dev/tty file, 754
escape sequences for nonprinting characters, 80
Gnome, 15
Linux virtual consoles, 83, 447
login and nonlogin shells, 45
Mac OS X, 44
outputting text from command line into, 770
reading from, process groups and, 453
reading/writing from, 885
screen editors vs., 93
settings in .cshrc.$HOST file, 60
status line, 77
status line, current directory information, 78
TERM environment varialbe, 703
termcap database, 94
TERMCAP environment variable, 706
terminfo database, 94
tty number for current users, 38
tty types, 37
unkillable processes, 479
windows without shells, 482
WTS, connecting to with Citrix, 963-966
terminating
loops, 623
processes
signals for, 468
processes, stopping vs., 439
terminating lines (see newlines)
terminfo database, 80, 94
resizing windows, 100
terminfo entries, 338
test command, 735
-a and -o (and and or) operators, 770
numeric tests, errors in, 777
sed editor
script.tidy using in, 783
string tests, syntax errors, 778
versions of, 735
in while loops, 728
test (t) command, sed editor, 695
testing
character strings using expr, 764
exit status with if statement, 716-718
find command results, 181
interactive programs with Expect, 570
strings with case statement, 770
terminal type with tset command, 95
TEX
CTAN, 929
typesetting with, 928
text
analyzing
paired items, checking, 305
converting files into printing language, 930
copying and pasting between windows running vi, 343
copying and pasting in xterms
between windows, 120-122
large selections with xclipboard, problems with, 119
xclipboard, using, 117-118
editing features in Emacs, 356
editors for (see editors)
empty files and, 898
formatting for phototypesetters, 915
formatting with enscript command, 922
formatting with pr command, 920-922
handling with temporary files, 563
highlighting with hgrep, 260
outputting to an X window, 770-772
titlebars and icons, setting xterms for, 111
transformations on, using sed editor, 680
text files
filename extension, 18
newline character in, 27
text processing
columns
making automatically with column, 413
making with pr, 411-413
converting with dd utility, 410
indenting text, 396
neatening text with fmt, 391
paired item checking, 305
re-formatting comment lines, 394
removing mail/news headers, 395
rotating text, 419
selecting and cutting columns, 410
splitting files by context, 401-404
straightening jagged columns, 415
Text widget commands, editing text sent to xclilpboard, 118
Text::Autoformat Perl module, 393
textual analysis
words, extracting, 306
TFTP (Trivial File Transfer Protocol), 974
then statement, 717
empty, creating with : operator, 746
tilde (~) operator, 51
time
fields in crontab entries, 490
file changes and modifications, 154
finding oldest or newest files by, 155
of login, recording, 43
picking to run at jobs, 497
showing with history command, 599
on Unix systems, 781
(see also date and time; timestamps)
time command, 502, 503, 744
time daemon, 781
time operators, find command (-mtime, -atime, and -ctime), 178, 179
Time to go now.... message, 498
timeout keyword, 567
timestamps, 154
arbitrary, creating files with, 179
comparing with make program, 231
inode information, 263
kept by tcsh and zsh with their history, 599
listing with diff commands, 222
listing/finding files by, 155, 162, 168
sed editor and, 672
timex command, 504
timezones, TZ variable for, 707
timing programs, 503
tip program, 568
titlebars in xterm, 111
/tmp directory, 823
history files in, 607
sharing with SMB network, 953
tolower command (awk), 388
toolkits (X Window), 130
top command, 459, 501
top-level domains (TLDs), 946
touch command
creating file with arbitrary timestamp, 179
-i file, creating for file deletion, 267
toupper command (awk), 388
tpipe command, 896
tr command, 305, 404-406
Berkeley vs. System V, 404
converting characters, 11
-cs options, listing words in a file, 307
-d option, deleting characters in strings, 406
filtering vi text through to convert case, 323
NUL-separated entries from environ file, translating to newline-separated lines, 466
squeeze option, 406
storing control characters in shell variables, 783
traceroute program, 942
tracked aliases, 520, 575
transform command (y), sed editor, 680, 683-685
translation tables, 131
example, 133
syntax for specifying as a resource, 132
Transport Control Protocol (see TCP; TCP/IP)
trap command, 86, 469, 471
exits caused by interrupted scripts, 721
signals for, 722
trapping signals, 469
trash directory, 268
trees, directory (see under directories)
troff, 926, 928
troubleshooting
stalled data connections, 102
stray prompt problems, 73
true command, 746
true (exit status) utility, 715
true or false values in Perl, 847
trusted-host authentication, problems with, 1016
tset command, 55, 95
key settings, changes in, 106
-m (map) option, 95, 97
-Q (quiet) option, 96
T-shell (see tcsh shell)
TSTP (stop) signal, 468
tty, 7
tty command, 37, 460
tty number
displaying with usernames, 38
in ps listing, 459
tty serial port, for activity monitoring, 452
ttys and ttytab files, 58
tty-type virtual consoles, 448
twm window manager, 961
type command, 36, 524
-type operator (find command), 183, 184
typescript file, 782
typeset -f command, listing functions you've defined, 585
typesetting, 915
converting typeset files into printing language, 931
manpages with nroff, 927
overview, 925
Unix history of, 926
typos, fixing with vi abbreviations, 330
TZ (timezone) environment variable, 707
U[ Top ]
/u directory, 629
UAs (User Agents), 945
uc operator, 846
UDP (User Datagram Protocol), 936, 937
UIDs (see user IDs)
ulimit -f command, 280
umask command, 631
default mode for newly created files, 985
permission values, setting, 997
setting in shell scripts, 455
subshell, running in, 773
umount command, 906
unalias command, 575
uname -n command, 36
uncompressing files, 282
bunzip2 program, 283
underscore (_) in filenames, 16
undoing
actions in Emacs editor, 354
deletions with vi editor, 313
edits in vi editor, 334
search and replace commands with vi editor, 315
unformatted manpage files, 35
uniq command, 418
sort -u vs., 427
testing for duplicate terms, 305
Universal Serial Bus (USB), 911
Unix
advantages of, 3, 4
communicating with, 6
networking and communications utilities, 28
priority, definition of, 507
versions of, xxx
unkillable processes, cleaning up, 479
unless statements, 852
unlimit coredumpsize command, 281
unlink( ) system call, 272
unlink function, 856
unlocking files (RCS), 816
unmatched pieces of code, errors caused by, 776
unset -f command, deleting definition of function, 585
unset variables, errors caused by, 778
unsetenv command, 704
unshift operator (Perl), 849
until loops, 623
nonzero exit status, 773
test command used with, 735
testing exit status in Bourne shells, 719
while loops vs., 720
updatedb shell script, 190
updating
CVS files, 819, 820
distributed database, 232
information on available packages with apt-get, 834
upgrading installed packages with apt-get, 834
uppercase (see case)
uptime command, 87, 501, 506
URI for software package source, 832
urllib module, 876
urllib2 module, 876, 877
URLs for Java applet VNC desktops, 960
USB (Universal Serial Bus), 911
Usenet, 29
eight-bit text, encoding into seven-bit, 406
GNUS client in Emacs, 357
User Agents (UAs), 945
User Datagram Protocol (see UDP)
user defined subroutines (Perl), 845
USER environment variable, 706
user IDs (UIDs), 453
in passwd file, 983
user interfaces (see GUIs)
-user operator (find command), 186
user time, 503
useradd utility, 984
user-based access control, 143
username field in crontab entries, 490
users
backing up directories, 791
login shell, killing, 471
RCS files, listing for, 817
UID, 983
Unix user/group infrastructure, 982
adding to Unix systems, 982-984
disabling logins, 993
file ownerhsip and, 995
group permissions in directory with setgid bit, 985
groups and group ownership, 986-988
groups that deny permissions, 988
substitute identity with su, 990
SUID and SGID scripts, 989
superpowers with sudo application, 991
usernames, 983
in shell prompt, 71
users command, 733
user-space tools to configure devices, 900
/usr directory, 823
/usr/bin directory, 822
local programs and, 210
programs in, 13
/usr/bsd directory
remote shell (rsh), 143
/usr/dict/words file, 299
/usr/lib/crontab file, 489
/usr/lib/crontab.local file, 489
/usr/libexec/makewhatis file, 33
/usr/lib/spell directory, 299
/usr/lib/X11/app-defaults file, 139
/usr/local directory, 210
/usr/local/bin directory, 822
/usr/local/man directory, 35
/usr/man directory, 35
/usr/share/man directory, 35
utilities
combining, 700
relationship with kernel, shell, and applications, 8
(see also individual utility or command names)
UUCP (Unix-to-Unix copy), 29
uudecode command, 408
uuencode utility, 407
uuencoding, 406
uuname -l command, 36
V[ Top ]
-v (verbose) option, 760
values function (Perl), 851
values, Python objects, 873
/var directory, 823
variable substitutions, 12
Bourne shell quoting and, 528
editing by shells, 547
editing with : (colon) string editing operators, 547-549
variable-length records, converting to/from fixed length, 410
variables
awk utility, 382
class variables (Python), 873
environment (see environment variables)
inheritance of, 711
instance variables (Python), 873
multiple, creating for loops with, 750
Perl (see Perl)
resource (X Window System), 128
scanning contents with eval, 751
set to word lists, 779
shell (see shell variables)
substitution of (see variable substitutions)
variable-width columns, creating with column utility, 414
/var/log/lastlog file, 43
/var/log/wtmp file, 43
/var/run/utmp file, 43
varying commands while repeating them, 554
Vaults of Parnassus (Python repository), 870
verbose option (Bourne shell), 760
verbose shell variable, 533
version control systems, 814
CVS, 818-821
Emacs support of, 356
RCS, 815-818
saving every file version, 790
versions
of commands, 36
Perl, 840
verifying on your system, 842
UNIX, xxx
vgrep script, 665
vi editor, 308-335
^ and $ characters, use of, 639
abbreviations, 328-331
commands, using as, 330
fixing typos with, 330
appending to existing file, 317
autowrite option, 442
capitalizing words, 320
centering lines of text, 398
command-line editing, 610
compound searches, 327
confirming substitutions in, 315
counting occurrences and stopping search wraps, 320
custom commands, creating, 336-352
cursor motion in text-input mode without arrow keys, 349
file-backup macros, 351
@-functions, 340-343
keymaps for pasting into window running vi, 343
macro for splitting long lines, 350
map commands, 336-340
mapping keys in vi, further examples, 347
maps for repeated edits, 345
noremap command, 350
protecting keys from interpretation by ex, 343
repeating a keymap, 348
typing in uppercase without CAPS LOCK, 348
defining alternate vi environments, 312
deleting text blocks by patterns, 318
development of, 93
file ownership, 999
file recovery with vi -r, 324
recovered buffers, cautions about, 325
filtering text through Unix command, 322
fmt command, neatening lines with, 333
grep command, command substitution with, 562
keys available for user-defined commands, 337
line vs. character commands, 331
local settings for, 312
marking place with m command, 334
moving blocks of text by patterns, 317
multiple setup files, 321
pattern matches, global commands with, 318-320
recovering past deletions in numbered buffers, 313
regular expressions in search and replacement patterns, delimiting, 675
requote script, using, 121
running ex scripts, 373
saving old and new version of file, 316
saving part of a file, 316
search patterns and global commands, using, 314
global searches, 315
setting up with .exrc file, 334
shell escapes, 326
signals, ignoring, 469
switching between files, 309
buffers, using to copy or move text, 313
transferring text with yank buffers, 311
temporary space, running out of, 332
translating strings with tr -d command, 406
vim editor, 308
virtual consoles (Linux), 83, 447
switching between, 92, 447
tty-type, scrolling and copy and paste, 448
virtual machine running Windows, 962
virtual memory statistics, 977
Virtual Network Computing (see VNC)
vis command, 554
C shell history compared to, 558
-d option, 558
-s option, 559
variations of (display, rep, watch), 559
VISUAL environment variable, 705
Vixie cron, 489
crontab file, creating, 490
Linux shortcuts to cron tasks, 493
month and day names in crontab entry time fields, 490
vmstat command, 977
vmware program, 962
VNC (Virtual Network Computing), 959-962
connecting to Windows VNC server, 960
setting up on Unix, 960
vold daemon, 907
VT Fonts menu (xterm), 113, 114, 115
Escape Sequences and Selection, enabling, 116
VT Options menu (xterm), 113
enabling scrollbars, 108
mode toggles, 114
vulnerabilities, 969
buffer overflow, 972
CERT web site information on, 971
file modification without write access, 1003
Microsoft security bulletins about, 971
W[ Top ]
\w in regular expressions, 641, 855
\W (non-word character character), 641
W3 mode (Emacs), 357
wait command, 480
in background jobs, 716
warning or error messages
Perl (-w option), 843
signals as, 468
watch command, 559
watchq script, 472
wc (word count) command, 303
-c, -l, and -w options, 303
whitespace in output, 304
web browsers (see browsers)
Web, described, 28
web-browser mode (Emacs), 357
webjump feature, Emacs, 357
well-known ports, database of, 938
werase key, 105
wfcmgr program, 964
wget utility, 834-836
options, 835
What You See Is What You Mean (WYSIWYM) editing, 929
whatis command, 33
wheel (superuser group), 983, 988
whence command, 36
whereis command, 33
options, 34
rsh, checking version of, 142
testing command names, 736
which command
alternatives to, 36
checking for existing command names, 736
rsh, checking version of, 142
setting the prompt variable, 53
while command (awk), 388
while loops, 623
asking for variable names and displaying values, 777
case, shift, and test commands, using with, 728
endless, 746, 771
/g pattern modifier and, 856
handling command-line arguments, 728
in Perl script, 844
read command used in, 750
with several loop control commands, 753
stepping through command-line arguments, 726
test command used with, 735
testing exit status, 720
whitespace
blank lines, squashing extra with cat -s, 241
displaying in a line with cat command, 238
in filenames, 165, 533
finding files with, 180, 273
ignoring in sort command, 428
leading, removing in Emacs from series of lines, 356
matching in Perl regular expressions with \s, 855
newline character, 27
removing from text with dedent script, 121
separating command arguments, 8
shell functions, spaces in, 581
SPACE characters, ASCII, 110
TAB characters
ASCII, 110
stripping in Bourne shell scripts, 535
wc command output, 304
who am i command, 56
who command, 38, 562, 733
examples, 698
GNU version, 38
whois command, 946
wildcards, 18-20
!$ sequence for safety with, 597
in aliases, 520
in case statements, 713, 714
deleting files, use in, 264
for dot files, 273
file creation and, 544
file-naming, 657-667
expansion by shells, 660
failing to match, 662
file name and extension as separate entities, 660
grep -c, listing nonmatching files, 664
grep -l command, listing matching files, 664
in pathnames, 658
listing of, 658-660
nom script, listing nonmatching files, 666
pathnames, not using in, 663
shell handling of, 660-662
vgrep script, listing nonmatching files, 665
in for loops, 728
limiting searches with, 188
ls command, using shell wildcard pattern, 161
regular expressions vs., 634
set command using, 734
shell expansion of, 634
shell, matching with fast find commands, 189
tar, using with, 800-803
GNU tar, 801-803
Windows
connecting Unix machines to, 951-966
Citrix, connecting to WTS server, 963-966
connecting to SMB shares from Unix, 959
emulators and APIs, 962
printing with Samba, 958
Samba, installing and configuring, 951
securing Samba, 955
sharing desktops with VNC, 959-962
swat and GUI SMB browsers, 956
dual-booting with Unix, 904
printing over Samba, 923
from Unix to Windows printer, 924
to Unix printers, 924
Python interface to wxWindows toolkit, 875
quote characters, formatting for Unix, 120
security bulletins from Microsoft, 971
SMB-shared filesystems, mounting on Unix, 909
WYSIWYG editors, typesetting with, 925
windows
chain of processes leading to, 480-482
closing by killing window processes, 484-487
shell script, using, 486
web browser (example), 485
xterm window (example), 484
Emacs, 354
Gnome, on Linux, 15
Linux, listing on, 14
session info in title, 77
starting new from shell, 454
terminal without shells, 482
testing size for, 58
twm window manager on VNC, 961
xmessage, setting to fit text, 772
(see also terminals; X Window System; xterm)
wine program, emulating Windows API, 962
"Winmodems,", 910
WINNAME environment variable, 59
wish shell, 10
word lists
ispell program, 301
munchlist script, 302
spell command, in spellhist file, 301
variables set to, 779
word vectors, 524
WORDLIST environment variable, 297
overriding default personal word list, 301
words
abbreviation in vi editor, 328-331
commands, using as, 330
fixing typos with, 330
breaking string into with :x operator, 549
counting with wc command, 303
doubled, 305
extracting, 306
matching with \< \> in regular expressions, 643
selection
in xterm, 110
work function, 582, 586
workgroups, 951
working area (CVS), 818
repository for, 819
updating workspace, 820
workstations
configuring with DHCP, 947
display, 15
private NAT for, 949
world (file ownership), 995
World Wide Web, described, 28
world-write file permissions, 997
sticky bit, setting for directory, 999
wrappers
shell script, for other scripts, 724
TCP, checking logs in intruder detection, 980
wrapping lines in vi, macro for, 350
write command, 30, 37
ex editor, 372
running from a daemon, 473
write permission
changing with chmod, 1000
denying, 1002
for directories, 148
implications of, 995
renaming or removing files, 999
directories, renaming or removing files, 999
files, modifying without, 1003
finding files by, 185
group, 998
script for adding, editing file, then removing, 1002
scripts for changing, 1003
writewav.pl script, 842
writing output to terminal, enabling/disabling for background jobs, 444
writing-tar process, 216
wtmp file, login information, 43
WTS (Windows Terminal Services), connecting to with Citrix, 963-966
ww function, 305
ww.sh script, 305
wxPython GUI, 875
WYSIWYG (What You See Is What You Get) editing programs, 367
WYSIWYM editors, 929
X[ Top ]
x (exchange) command, sed, 681, 688
:x (string editing) operator, breaking line into words, 549
X toolkit, 130
X Window System, 30
closing window by killing its processes, 484
defining keys and button presses with xmodmap, 124-127
DISPLAY environment variable, 710
keysym mappings, using xev to learn, 127
outputting text into terminal with xmessage, 770-772
remote logins, 140
resize command, 59
resources
event translations, overview, 130-133
setting, 133-140
syntax of, 128-130
server and screen numbers, 710
shell, using from an xterm, 480-482
starting remote clients, 140-143
from interactive logins, 141
with rsh and ssh, 142
testing window size, 55
who am i command, 56
X forwarding, problems with, 1029
xmodmap command, 105
xargs command, 563
-0 option, 180
completed filenames, passing to with sed, 187
egrep arguments, handling, 192
egrep, using with, 194
-exec operator (find command) vs., 180
find command, using with, 174
grep output, pipelining, 257
piping locate output to, 188
xargs utility, 565-567
-n option, 566
-p option, 566
xauth command
copying access code to remote machine, 143
xclipboard
setting up xterm to use, 140
xclipboard window, 117-118
large text selections, problems with, 119
.Xdefaults file, 129
xrdb utility vs., 133
-xdev operator (find command), 197
preventing networked filesystem searches, 200
XEmacs (Lucent Emacs), 357
xev utility, 127
xgrep script, 648
xhost command, 141
executing before rsh, 143
xmessage utility, 770-772
XML, 929
xmodmap program, 105, 127
defining keys and button presses, 124-127
xrdb utility, 129, 133, 136-139
-backup option, 138
-edit option, 138
-load option, 139
-merge option, 137
-query option, 137
removing definitions, 138
.Xresources file, 129
xterm, 30
built-in logger, 783
chain of processes leading to window, 480-482
closing window by killing its processes, 484
color, 79
configuring, 106-123
copy and paste, 109
copy and paste between windows, 120-122
fonts, changing dynamically, 115-117
fonts, selecting, 112
login shell, 107
menus, 113-114
saved lines, 109
scrollbars, 108
titlebar and icon text, 111
words, defining for text selection, 110
xclipboard, 117-118
copy and paste, 557
-e option, 122, 123
login shells, 44
size of windows, 58, 99
starting windows, 454
terminal window without shells, 482
window title, 77
showing command line in, 87
xwrist script, 771
Y[ Top ]
y (transform) command, sed editor, 680, 683-685
yank buffers, 313
yes command, 784
Z[ Top ]
.Z file extension (compress program), 284
Z shell (see zsh)
zap script (interactively killing processes), 477
zcat command, 283
ZDOTDIR environment variable, 47
zero string length, testing for, 739
zeros in /dev/zero file, 899
Zip disks
backing up to, 794
mounting, 906
zless command (less for compressed files), 283
.zlogin file, 47
zmore script, 721
arguments for, 726
for loops in, 727
zombies, 461, 470, 480
.zprofile file, 47
zsh (Z shell), 10, 47, 513
{ } (pattern-expansion characters), building strings with, 545
&! and &| operators for background processes, 446
aliases, 571, 574, 576
arrays, 195
expanding ranges, 196
bg_nice option, 482
built-in arithmetic, 584
cd +n and cd -n commands, moving directory in stack, 626
command-line editing, 615
completion features, 549
command-specific, 551
configuration files, 47
disown command, 446
editing history substitutions, 547
environment variable for shell function, changing, 586
exit status of command line, reversing, 716
fc -l command, listing previous commands with, 598
foreach loop, 554
FPATH search path for shell functions, 590
globbing (wildcard expansion), 660
histchars variable, 615
history file, 606
limiting file size, 280
login shells, creating, 61
MULTIOS option, 894
options, resetting for shell functions, 586
passing command history to, 608
pre-prompt commands, 87
PRINT_EXIT_VALUE option, 716
prompts
%!, getting history number with, 72
dynamic, 72
right-side, 81
secondary, showing names of continuing constructs, 560
setting, 71
redirecting standard I/O, 887
repeating commands with repeat loop, 554
SAVEHIST variable, 606
shell variables, read-only, 712
SHLVL environment variable, 82
special characters/operators, 536-539
wildcards, failing to match, 663
.zshenv file, 47
.zshrc file, 47, 74, 87
Zurück zu Unix Power Tools