This concise programming companion prepares students for programming in the LINUX environment. The authors begin with a brief review of commands and utilities and then focus on systematically describing those software development tools available to a LINUX programmer. These software development tools include utilities for managing libraries for object files and profiling. LINUX & UNIX Programming Tools assumes no previous exposure to LINUX and is appropriate for students and software practitioners alike.
Student support files for Sarwar can be found at http://www.aw-bc.com/cssupport/Sarwar.html.
- Contains a unique introduction to LINUX's software development tools. Topics include the C/C++ and Java compilers.
- Includes a brief introduction to user-level services offered by LINUX that allows students to effectively, efficiently, and securely use the system while developing software on it.
- Commands covered are those common to all LINUX systems and most often used in command specific flavors.
- Provides in-chapter exercises, which give timely reinforcement and practice of new commands and tools.
Table of Contents
(Each Chapter ends with a Summary and Questions and Problems Section).
I. USING LINUX EFFECTIVELY. 1. Fundamentals.
Logging On and Logging Off.
Some Important System Setups.
Some Useful General-Purpose Commands for the Beginner.2. File System Structure and File Processing.
Files in LINUX.
File System Structure.
File System Structure.
Home and Present Working Directories.
Pathnames: Absolute and Relative.
Some Standard Directories and Files.
Directory Operations and Browsing the File System Structure.
Creating and Removing Directories (mkdir, rmdir, rm -r).
Moving and Copying Directories (mv, cp -r).
Browsing the File System Structure and Listing Directories (cd, ls).
Creating files (vi, emacs, pico).
Displaying File Type and Type of Data in a File (ls -l, file).
Viewing Complete Files (cat).
Viewing Files One Page at a Time (more, less).
Viewing the Head or Tail of a File (head, tail).
Displaying the NIS Database (ypcat).
Copying Files (cp).
Moving Files (mv).
Removing/Deleting files (rm).
Determining File Size (ls -l, wc).
Appending to Files (cat >>).
Comparing files (diff).
Compressing Files (gzip, gunzip, gzexe, zcat).3. Input, Output, and Error Redirection.
Standard Files, File Descriptors, and Redirection of Standard Files.
Input, Ourput, and Error Redirection.
Input Redirection (<, 0<).
Output Redirection (>, 1>).
Error Redirection (2>).
Redirecting stdin, stdout, and stderr in One Command.
Appending Data to a File (>>).
LINUX Filters and Pipes (<F128><124>, pr, tr, uniq, etc.).
Redirection and Piping Combined.
The tee utility.4. Printer Control.
LINUX Mechanism for Printing Files.
Printer Control Commands (lpr, lpq, lprm, lpc, lptest).
Printing Files (lpr).
Finding the Status of a Print Request (lpq).
Canceling Print Jobs (lprm).
Controlling Printers (lpc).5. File Security.
File Protection Based on Access Permission (mail, pine).
Types of Users.
Types of File Operations/Access Permissions.
Determining Files Access Privileges (ls -l, ls -ld).
Changing File Access Privileges (chmod).
Default File Access Privileges (umask).6. LINUX Processes.
Processes, Jobs, and Daemons.
Process and Job Control and Process Control.
Displaying Process Attributes (ps).
Real-Time Monitoring of the CPU Activity (top).
Foreground, Background, and Suspended Processes (&, fg, bg, ).Displaying Jobs (jobs).Suspending and Resuming a Shell Process (suspend).Running Commands Sequentially and Simultaneously (;, &).Abnormal Termination of Commands and Processes (, kill).Process Hierarchy in LINUX (pstree).Displaying Process and File Attributes in LINUX (limit, ulimit).7. File System Backup.
Introduction.Archiving and Restoring Files Via tar.Archiving Files (tar cvf).Restoring Archived Files.Complete Restoration (tar xvf).Partial Restoration.Copying Directory Hierarchies.
II. PROGRAM DEVELOPMENT ON A LINUX PLATFORM. 8. Program Development Process.
Introduction.An Overview of Computer Programming Languages.The Compilation Process.The Interpretation Process.Compiling C, C++, and Java Programs.The Software Engineering Lifecycle.9. Program Generation Tools.
Introduction.Generating Program Source Files.Indenting Source Code.Compiling C/C++ Programs.Dealing with Multiple Source Files.Linking Libraries.Optimizing Executable Code.Defining Macros at Command Line.Turning off Compilation, Assembly, or Linking Phase.Compiling Java Programs.10. Handling Multi-Module Software.
Introduction.The make Utility.Makefile and Make Rules.Multi-module Software, Dependency Trees, and make.Suffix (Default) Rules.Macro Support of the make Utility.Built-in Macros.Dummy Targets.Special Targets.Common Syntax Errors and Their Cure.Command-line Usage and Debugging.11. Developing and Using Libraries.
Introduction.The ar Utility.Creating an Archive.Displaying the Table of Contents.Deleting Object Modules from an Archive.Extracting Object Modules from an Archive.Ordering Archives.The nm Utility.Displaying Symbol Table Information.12. Source Code Debugging.
Introduction.Source Code Debugging.The Debug Process.Various Debugging Approaches.The GNU gdb Debugger.Using gdb with C or C++ Programs.Starting gdb.Executing a Program Inside gdb.Tracing Program Execution.Setting Breakpoints.Single Stepping through Your Program.Printing Values of Variables and Expressions.Listing Program Code.Examining Function Call Stack.Fixing the Bug.Quitting gdb.Debugging a Crashed Program with “core” File.Debugging a Process.Debugging Java Programs with gdb.Using gdb Under emacs.13. Software Profiling and Metrics.
Introduction.Software Profiling.Profiling with gprof.Measuring Source Code Metrics.Measuring Lines of Code (wc).Measuring the Size of Executable Code (ls -l).Measuring the running time of a program with the time command.14. Version Control.
Introduction.What is Version Control.The Revision Control System (RCS).Working with RCS.Creating an RCS History File.Checking out an RCS File.Creating a New Version of a File.Checking out Copies of Specific Versions.Abandoning Changes.Locking a File Without Overwriting (Take Care of a Mistake).Removing a Version.Working in Groups.Displaying the History of RCS Files.Breaking Locks.Displaying Differences Between Versions.Merging Versions.Limiting Access Rights to RCS.RCS Special Character Sequences.Miscellaneous RCS Utilities.Using RCS from Within emacs.Beyond RCS.Concurrent Versions System (CVS).CVS Command Syntax.Displaying CVS Help.Creating a Source Repository.Importing Sources into the Repository.Checking Out Source Files.Making and Committing Changes to Source Files.Adding New Files and Directories to the Source Repository.Removing Files and Directories from the Source Repository.Freezing and Extracting a Version.Displaying Differences.Displaying the Log History.CVS Special Character Sequences.After Work Cleanup.Remote Repositories and Accessing Them Through Client.Using CVS Under emacs.Important Aspects of CVS.Obtaining and Installing CVS.Appendix A: Editing Text Files with Vi and Pico.
Appendix B: Electronic Mail.
Appendix C: Glossary.