Learning the UNIX Operating System
Table of Contents
Preface .................................................................. ii
The UNIX Operating System ................................................ xi
Versions of UNIX ........................................................ xii
What this Handbook Covers ............................................... xii
What's New in the Third Edition ........................................ xiii
Format ................................................................. xiii
Commands .......................................................... xiii
Examples ........................................................... xiv
Problem Checklist .................................................. xiv
Exercises .......................................................... xiv
A Note to Our Readers ............................................... xv
Acknowledgments .......................................................... xv
1: Getting Started ..................................................... 1
Working in the UNIX Environment ........................................... 1
Connecting to the UNIX Computer ...................................... 1
Logging In ........................................................... 2
Remote Logins ........................................................ 4
The UNIX Shell ....................................................... 5
The Shell Prompt ..................................................... 5
Entering a Command ................................................... 6
Correcting a Mistake ................................................. 7
Logging Out .......................................................... 8
Syntax of UNIX Commands ................................................... 9
Types of Commands ........................................................ 11
The Unresponsive Terminal ................................................ 11
2: Using Window Systems ................................................ 15
Introduction to Windowing ................................................ 15
Starting X ............................................................... 16
A. Ready to Run X (with xdm) ....................................... 17
B. Starting X from a Standard UNIX session ......................... 18
C. Starting the Window Manager ..................................... 18
Running Programs ......................................................... 19
Setting Focus ....................................................... 19
The xterm Window .................................................... 19
The Root Menu ....................................................... 20
Working with a Mouse ..................................................... 21
Pointer Shape ....................................................... 21
Pointing, Clicking, Dragging ........................................ 22
Using a Mouse with xterm Windows .................................... 22
Working with Windows ..................................................... 23
Using the Titlebar .................................................. 23
Moving Windows and Icons ............................................ 24
Resizing Windows .................................................... 24
The Window Menu ..................................................... 25
Other X Clients .......................................................... 26
Quitting ................................................................. 27
3: Your UNIX Account .................................................. 29
The UNIX Filesystem ...................................................... 29
Your Home Directory ................................................. 29
Your Working Directory .............................................. 30
The Directory Tree .................................................. 30
Absolute Pathnames .................................................. 31
Relative Pathnames .................................................. 32
Changing Your Working Directory ..................................... 34
Files in the Directory Tree ......................................... 35
Listing Files ....................................................... 36
Looking Inside Files ..................................................... 39
Protecting and Sharing Files ............................................. 42
Directory Access Permissions ........................................ 42
File Access Permissions ............................................. 42
Electronic Mail .......................................................... 43
Sending Mail ........................................................ 43
Reading Your Mail ................................................... 45
Customizing Your Account ................................................. 47
4: File Management .................................................... 49
Methods of Creating Files ................................................ 49
File and Directory Names ................................................. 50
File and Directory Wildcards ............................................. 50
Managing Your Files ...................................................... 51
Copying Files ....................................................... 52
Renaming and Moving Files ........................................... 56
Finding Files ....................................................... 56
Creating Directories ................................................ 57
Removing Files and Directories ...................................... 57
Printing Files ........................................................... 59
Viewing the Printer Queue ........................................... 62
5: Redirecting I/O .................................................... 65
Standard Input and Standard Output ....................................... 65
Putting Text in a File .............................................. 65
Pipes and Filters ........................................................ 68
6: Multi-tasking ...................................................... 73
Running a Command in the Background ...................................... 73
Checking on a Process .................................................... 74
Cancelling a Process ..................................................... 75
7: Where to Go From Here ............................................... 77
Standard UNIX Documentation .............................................. 77
Online Documentation ..................................................... 77
Interesting Things to Learn .............................................. 78
Editors ............................................................. 78
Shell Programming ................................................... 79
A: Reading List ........................................................ 81
General UNIX Books ....................................................... 81
Text Processing .......................................................... 82
Electronic Mail and Communications ....................................... 82
Shells and Shell Programming ............................................. 82
The X Window System ...................................................... 83
B: Reference ........................................................... 85
Commands and Their Meanings .............................................. 85
Special Symbols .......................................................... 86
Figures
2: Using Window Systems ................................................. 15
2-1 An X display with the mwm window manager ............................. 16
2-2 Some possibilities ................................................... 17
2-3 Copying and pasting a command Line ................................... 23
2-4 A window running with the Motif Window Manager ....................... 24
2-5 The mwm window menu .................................................. 25
3: Your UNIX Account ................................................... 29
3-1 Example of a directory tree .......................................... 30
3-2 Absolute path of directory john ...................................... 32
3-3 Relative pathname from work to play .................................. 33
3-4 Files in the directory tree .......................................... 35
3-5 Output from ls -al ................................................... 37
Tables
3: Your UNIX Account ................................................... 29
3-1 Useful more Commands ................................................. 41
3-2 Mail Commands (at mail Prompt) ....................................... 46
4: File Management ..................................................... 49
4-1 Some ftp Commands .................................................... 55
4-2 Useful Options of pr ................................................. 60
4-3 Useful Options of lp and lpr ......................................... 61
5: Redirecting I/O ..................................................... 65
5-1 Useful grep Options .................................................. 70
5-2 Useful sort Options .................................................. 70