A Practical Guide to Linux Commands, Editors, and Shell Programming
Mark G. Sobell
The essential reference for core commands that Linux users need daily, along with superior tutorial on shell programming and much moreSystem administrators, software developers, quality assurance engineers and others working on a Linux system need to work from the command line in order to be effective. Linux is famous for its huge number of command line utility programs, and the programs themselves are famous for their large numbers of options, switches, and configuration files. But the truth is that users will only use a limited (but still significant) number of these utilities on a recurring basis, and then only with a subset of the most important and useful options, switches and configuration files. This book cuts through all the noise and shows them which utilities are most useful, and which options most important. And it contains examples, lot's and lot's of examples. This is not just a reprint of the man pages.
And Linux is also famous for its "programmability." Utilities are designed, by default, to work wtih other utilities within shell programs as a way of automating system tasks. This book contains a superb introduction to Linux shell programming. And since shell programmers need to write their programs in text editors, this book covers the two most popular ones: vi and emacs.
Table of Contents:
1. Welcome to Linux.
The GNU-Linux Connection
The Heritage of Linux: UNIX
What Is So Good About Linux?
Overview of Linux
Additional Features of Linux
I. THE LINUX OPERATING SYSTEM.
2. Getting Started.
Conventions Used in This Book
Working with the Shell
Curbing Your Power: Superuser Access
Getting the Facts: Where to Find Documentation
More About Logging In
3. Command Line Utilities.
Working with Files
| (Pipe): Communicates Between Processes
Four More Utilities
Compressing and Archiving Files
Obtaining User and System Information
Communicating with Other Users
4. The Linux Filesystem.
The Hierarchical Filesystem
Directory and Ordinary Files
Working with Directories
5. The Shell.
The Command Line
Standard Input and Standard Output
Running a Program in the Background
Filename Generation/Pathname Expansion
II. THE EDITORS.
6. The vim Editor.
Tutorial: Creating and Editing a File with vim
The compatible Parameter
Introduction to vim Features
Command Mode: Moving the Cursor
Command Mode: Deleting and Changing Text
Searching and Substituting
Yank, Put, and Delete Commands
Reading and Writing Files
Advanced Editing Techniques
Units of Measure
7. The emacs Editor.
Tutorial: Getting Started with emacs
Basic Editing Commands
III. THE SHELLS.
8. The Bourne Again Shell.
Parameters and Variables
Controlling bash Features and Options
Processing the Command Line
9. The TC Shell.
Entering and Leaving the TC Shell
Features Common to the Bourne Again and TC Shells
Redirecting Standard Error
Working with the Command Line
IV. PROGRAMMING TOOLS.
10. Programming Tools.
Programming in C
Using Shared Libraries
make: Keeps a Set of Programs Current
Debugging C Programs
Source Code Management
11. Programming the Bourne Again Shell.
Parameters and Variables
12. The gawk Pattern Processing Language.
Advanced gawk Programming
13. The sed Editor.
Part V: Command Reference
Standard Multiplicative Suffixes
The sample Utility
sample: Very brief description of what the utility does
aspell: Checks a file for spelling errors
at: Executes commands at a specified time
bzip2: Compresses or decompresses files
cal: Displays a calendar
cat: Joins and displays files
cd: Changes to another working directory
chgrp: Changes the group associated with a file
chmod: Changes the access mode (permissions) of a file
chown: Changes the owner of a file and/or the group the file is associated with
cmp: Compares two files
comm: Compares sorted files
configure: Configures source code automatically
cp: Copies files
cpio: Creates an archive or restores files from an archive
crontab: Maintains crontab files
cut: Selects characters or fields from input lines
date: Displays or sets the system time and date
dd: Converts and copies a file
df: Displays disk space usage
diff: Displays the differences between two files
du: Displays information on disk usage by file
echo: Displays a message
expr: Evaluates an expression
file: Displays the classification of a file
find: Finds files based on criteria
finger: Displays information about users
fmt: Formats text very simply
fsck: Checks and repairs a filesystem
ftp: Transfers files over a network
gcc: Compiles C and C++ programs
grep: Searches for a pattern in files
gzip: Compresses or decompresses files
head: Displays the beginning of a file
kill: Terminates a process by PID
killall: Terminates a process by name
less: Displays text files, one screen at a time
ln: Makes a link to a file
lpr: Sends files to printers
ls: Displays information about one or more files
make: Keeps a set of programs current
man: Displays documentation for commands
mkdir: Creates a directory
mkfs: Creates a filesystem on a device
Mtools: Uses DOS-style commands on files and directories
mv: Renames or moves a file
nice: Changes the priority of a command
nohup: Runs a command that keeps running after you log out
od: Dumps the contents of a file
paste: Joins corresponding lines from files
pr: Paginates files for printing
ps: Displays process status
rcp: Copies one or more files to or from a remote system
rlogin: Logs in on a remote system
rm: Removes a file (deletes a link)
rmdir:Removes a directory
rsh: Executes commands on a remote system
scp: Securely copies one or more files to or from a remote system
sleep: Creates a process that sleeps for a specified interval
sort: Sorts and/or merges files
split: Divides a file in into sections
ssh: Securely executes commands on a remote system
strings: Displays strings of printable characters
stty: Displays or sets terminal parameters
tail: Displays the last part (tail) of a file
tar: Stores or retrieves files to/from an archive file
tee: Copies standard input to standard output and one or more files
telnet: Connects to a remote system over a network
test: Evaluates an expression
top: Dynamically displays process status
touch: Changes a file's access and/or modification time
tr: Replaces specified characters
tty: Displays the terminal pathname
tune2fs: Changes parameters on an ext2 or ext3 filesystem
umask: Establishes the file-creation permissions mask
uniq: Displays unique lines
w: Displays information about system users
wc: Displays the number of lines, words, and bytes
which: Shows where in PATH a command is located
who: Displays information about logged-in users
xargs: Converts standard input into command lines
Appendix A: Regular Expressions.
The Replacement String
Extended Regular Expressions
Appendix B: Help.
Solving a Problem
Finding Linux-Related Information
Specifying a Terminal
Appendix C: Keeping the System Up-to-Date.
yum: Updates and Installs Packages
Apt: An Alternative to yum