Home Page Icon
Home Page
Table of Contents for
III. Appendixes
Close
III. Appendixes
by Paul DuBois
Using csh & tcsh
Preface
Intended Audience
Scope of This Handbook
Part I, Learning the Basics
Part II, Becoming More Efficient
Part III, Appendixes
How To Read This Handbook
Conventions Used in This Handbook
Comments and Corrections
Acknowledgments
I. Learning the Basics
1. Introduction
Using the Examples
Selecting a Login Shell
Trying a Shell Temporarily
A Recommendation: Use tcsh, Not csh
Before You Read Further
2. A Shell Primer
Entering Commands
Command Input and Output
Files and Directories
Filename Patterns
“Invisible” Files
Creating Directories
Changing Your Current Directory
Removing Directories
Combining Commands
Running Commands in the Background
When Do Spaces Matter?
The Shell Startup Files
3. Using the Shell Effectively
Using Filenames
Letting the Shell Type Filenames for You
Using “Patterns” for Filenames that Don’t Exist
Using Shorthand for Home Directory Names
Letting the Shell Correct Your Spelling Mistakes
Dealing with Hard-To-Type Filenames
Reusing and Editing Commands
The Shell’s History List
Repeating Commands Using !-Specifiers
Repeating Commands Using the Command Editor
Repeating Part of a Command
Editing Commands
Repeating Commands Using a Loop
Creating Command Shortcuts
Using Command Substitution
Navigating the File System
How To Bounce Easily Between Two Directories
Letting the Shell Find Directories for You
Using Your Prompt
Using tcsh Prompt Formatting Sequences
Put a clock in your prompt
Make your prompt stand out
Put your current location in your prompt
Using Job Control
Why Job Control Is Useful
Basic Job Control
Stopping a job
Moving a job to the background
Bringing a job to the foreground
Killing a job
Stopping a background job
Dealing with Multiple Jobs
Referring to the current job
Referring to jobs by number
Referring to jobs by name
Job Control Shortcuts
What To Do When You See “There are stopped jobs”
II. Becoming More Efficient
4. The Shell Startup Files
Startup and Shutdown Files
Getting To Know .cshrc and .login
Modifying .cshrc and .login
Using Variables
Shell Variables
Environment Variables
Examining and Using Variable Values
Turning Off Variables
Making tcsh Shell Variables Read-Only
Paired Variables
Organizing Your Startup Files
Login Versus Non-Login Shells
Interactive Versus Non-Interactive Shells
Using the source Command
Protecting tcsh-Only Commands from csh
The .logout File
5. Setting Up Your Terminal
Identifying Your Terminal Settings
What the Settings Mean
Line Editing Settings
Process Control Settings
Changing Your Terminal Settings
Problems Typing the # and @ Characters
Getting Your Terminal To Backspace
Did Your Terminal Stop Working?
6. Using Your Command History
The History List
Reviewing Your History
Using Commands from Your History
Event Specifiers
Recalling the Previous Command
Referring to Commands by Number
Referring to Events by Command Name or Substring
Referring to the Current Event
Erroneous History References
Adding Text to Recalled Events
Resolving ambiguous additions
Word Designators
Word Designator Shorthand
Using Word Designators
Repeating a Set of Words
Repeating Words from the Current Command
Event Modifiers
Recalling Commands Without Executing Them
Substitution Modifiers
Repeating a substitution
Repeating the previous substitution
Checking a substitution
Filename Modifiers
Making History Persist Across Login Sessions
7. The tcsh Command-Line Editor
Editing a Command
Command Key Bindings
Getting Key Binding Information
Comparison of emacs Mode and vi Mode
emacs Editing Mode
emacs Cursor Motion Commands
emacs Modification Commands
Repeating emacs Commands
emacs History-Searching Commands
Using the Arrow Keys in emacs Mode
vi Editing Mode
Using vi Insert Mode
Using vi Command Mode
Cursor motion commands
Repeating commands
Adding text
Deleting text
Replacing text
vi History-Searching Commands
vi Character-Seeking Commands
Using the Arrow Keys in vi Mode
Examining and Modifying Key Bindings
Selecting a Set of Bindings
Getting a List of Editing Commands
Displaying Key Bindings
Displaying all bindings
Displaying individual key bindings
Specifying the key Argument
Options that modify interpretation of the key argument
Changing Key Bindings
Binding an individual key
Binding a key to itself
Removing a binding
Binding a key to a shell command
Binding a key to a literal string
Conflicts Between Terminal Settings and Key Bindings
Conflicts Between Key Bindings
8. Using Aliases To Create Command Shortcuts
Defining Aliases
Referring to Arguments in Aliases
Referring to the History List in Aliases
Getting Used to Aliases
Uses for Aliases
Aliases Save Typing
Aliases Can Redefine Commands
Aliases Hide Differences Between Systems
Using Sets of Aliases
9. File-Naming Shortcuts
Using Filename Patterns
Matching Multiple Characters
Matching Single Characters
Combining Pattern Operators
Patterns and Dot Files
Negating Patterns
Be Careful with Patterns
Pretesting Filename Patterns
Using {} To Generate Arguments
Directory Naming Shorthand
Referring to Home Directories Using ˜name
Referring to Directory Stack Entries Using =n
10. Filename and Programmed Completion
Using Built-In Filename Completion
Displaying Completion Matches
Narrowing the Scope of Completion Matches
Other Types of Completions
Listing Completion Matches Automatically
Completion and the tcsh Command Editor
Stepping through possible completions
Completion in mid-command
Completion and filename patterns
Programmed Completions
Syntax of the complete Command
Selecting the Word To Be Completed
Position-based word selection
Pattern-based word selection
Completing the Selected Word
Restricting the set of completion words
Choosing completions from a given directory
Displaying a message instead of listing matches
Supplying your own completion word list
Adding a suffix to the completed word
Specifying Multiple Completion Rules
Displaying and Removing Programmed Completions
When Programmed Completions Do Not Apply
11. Quoting and Special Characters
Special Characters
The Shell’s Quote Characters
Quoting the Quote Characters
Referring to Files with Problematic Names
Typing Difficult Filenames Using Filename Completion
Typing Difficult Filenames Using Filename Patterns
Quoting Special Characters Yourself
Passing Special Characters to Commands
Referring to a File When the Name Has a Leading Dash
Using Partial Quoting
Quoting Oddities
12. Using Commands To Generate Arguments
Command Substitution
Finding Files
Taking Arguments from a File
Processing Arguments Individually
Repeating Substituted Commands
Deferred Command Substitution
Verifying the Argument List
Dealing with unexpected output
Dealing with missing output
Verifying arguments using tee
Modifying the Argument List
When To Avoid Command Substitution
Filenames Containing Special Characters
Using xargs Instead of Command Substitution
Limitations of xargs
13. Navigating the File System
Moving Around
Working in Multiple Locations
Using cd – To Return to the Previous Directory
Using the Directory Stack
Stack Display Formats
Referring to Stack Entries in Command Arguments
An Alternative to the Directory Stack
Letting the Shell Find Directories for You
Limitations of cdpath
Using Aliases and Variables To Move Around
Moving Around Using Aliases
Moving Around Using Variables
Combining Aliases and Variables
14. Keeping Track of Where You Are
Types of Location Reporting
Displaying Your Location in the Prompt
Using csh To Display Your Location
Using a multiple-line prompt
Using tcsh To Display Your Location
Display Your Location in the Window Title
Communicating with xterm
Setting the Window Title in xterm
Setting the Window Title in Other Terminal Programs
HP-UX hpterm
NCSA Telnet for Macintosh
Putting It All Together
Displaying Other Types of Information
Displaying the Username
Setting the Window Icon in xterm
15. Job Control
Job States
Obtaining Job Information
Finding Out When Jobs Finish
The Current and Previous Jobs
Changing a Job’s State
Stopping a Job
Resuming a Job
Shorthand forms of fg and bg
Killing a Job
Killing stubborn Jobs
Suspending a Non-Login Shell
Other Applications of Job Control
Controlling Background Job Output
Backgrounding Interactive Jobs
Using Job Control To Improve System Response
Job Control and Window Systems
III. Appendixes
A. Obtaining and Installing tcsh
Obtaining the Source Distribution
Build the Distribution—Quick Instructions
Build the Distribution—Detailed Instructions
Overview of the Build Process
Choose an Installation Directory
Configure the Makefile
Configure config.h
Configure config_ f.h
Compile tcsh
Porting tcsh to a New System
Testing and Installing tcsh
Allowing tcsh To Be a Log in Shell
If Your System Does Not Use /etc/shells
B. csh and tcsh Quick Reference
Command Structure
Star tup and Shutdown Files
Variables
Defining, Removing, and Examining Variables
Using Variables
Special Characters
Special Characters in Filenames
Quote Characters
Command History
History Event Specifiers
Word Designators
History Modifiers
Moving Around the File System
Aliases
Filename Completion
Programmed Completion
Job Control
Command Editing in tcsh
emacs Mode Editing Commands
vi Mode Editing Commands
The bindkey Command
C. Other Sources of Information
Documents
Newsgroups
Mailing Lists
Index
About the Author
Colophon
Copyright
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
15. Job Control
Next
Next Chapter
A. Obtaining and Installing tcsh
Part III. Appendixes
Appendix A
Appendix B
Appendix C
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset