The Linux System

Introduction

Welcome, and thank you for using Mandrake Linux! This manual is aimed at people wishing to dive into the depths of their GNU/Linux system, and who wish to exploit its huge capabilities. It is made up of three parts:

  • In The Linux System, we introduce you to the command line and its various uses. We also discuss text-editing basics, which are essential under GNU/Linux.

    Chapter 1, Basic UNIX System Concepts presents the UNIX and, more specifically, GNU/Linux worlds. It introduces the standard file-manipulation utilities as well as some useful features provided by the shell. It is very important that you fully understand the concepts discussed in this chapter before going on to Chapter 3, Introduction to the Command Line. There is then a complementary chapter, Chapter 2, Disks and Partitions, discussing the way hard disks are managed under GNU/Linux, as well as the concepts of partitioning.

    Next, we cover Chapter 4, Text Editing: Emacs and VI. As most UNIX configuration files are text files, you will eventually want or need to edit them in a text editor. You will learn how to use two of the most famous text editors in the UNIX and GNU/Linux worlds: the mighty Emacs and the modern (!) Vi.

    You should then be able to perform basic maintenance on your system. The following two chapters present practical uses of the command line (Chapter 5, Command-Line Utilities), and process control (Chapter 6, Process Control) in general.

  • In Linux in Depth, we touch upon the Linux kernel and the filesystem architecture.

    Chapter 7, File Tree Organization explores the organization of the file tree. UNIX systems tend to grow very large, but every file has its place in a specific directory. After reading this chapter, you will know where to look for files depending on their role in the system.

    Then, we cover the topics of filesystems and mount points (Chapter 8, Filesystems and Mount Points). We define both these terms as well as explain them with practical examples.

    Chapter 9, The Linux Filesystem is dedicated to GNU/Linux filesystems. After presenting the available filesystems, we discuss file types and some additional concepts and utilities such as inodes and pipes. Chapter 10, The /proc Filesystem will introduce /proc, a special GNU/Linux filesystem.

    Chapter 11, The Start-Up Files: init sysv presents the Mandrake Linux boot-up procedure, and how to use it efficiently.

  • In Advanced Uses, we finish up with topics which only the brave or very skilled users will want to put to practice. Chapter 12, Building and Installing Free Software will guide you through the necessary steps to build and install free software from sources. Reading through this chapter should encourage you to try it out, even though it might look intimidating at first. Finally, Chapter 13, Compiling And Installing New Kernels is one of the last steps towards total GNU/Linux autonomy. After reading and applying the theory explained in this chapter, start converting Windows users to GNU/Linux (if you haven't started yet!).

We close this book with the two licenses generally used respectively for GNU/Linux software and documentation: Appendix A, The GNU General Public License and Appendix B, GNU Free Documentation License. A Appendix C, Glossary and the index concludes your Mandrake Linux –– PowerPack ProSuite Edition™ documentation.

Table of Contents

1. Basic UNIX System Concepts
Users and Groups
File Basics
Processes
Small Introduction to the Command Line
cd: Change Directory
Some Environment Variables and the echo Command
cat: Print the Contents of One or More Files to the Screen
less: a Pager
ls: Listing Files
Useful Keyboard Shortcuts
2. Disks and Partitions
Structure of a Hard Disk
Sectors
Partitions
Define the Structure of your Disk
Conventions for Naming Disks and Partitions
3. Introduction to the Command Line
File-Handling Utilities
mkdir, touch: Creating Empty Directories and Files
rm: Deleting Files or Directories
mv: Moving or Renaming Files
cp: Copying Files and Directories
Handling File Attributes
chown, chgrp: Change the Owner and Group of One or More Files
chmod: Changing Permissions on Files and Directories
Shell Globbing Patterns
Redirections and Pipes
A Little More About Processes
Redirections
Pipes
Command-Line Completion
Example
Other Completion Methods
Starting and Handling Background Processes: Job Control
A Final Word
4. Text Editing: Emacs and VI
Emacs
Short presentation
Getting started
Handling buffers
Copy, cut, paste, search
Quit Emacs
Vi: the ancestor
Insert mode, command mode, ex mode...
Handling buffers
Editing text and move commands
Cut, copy, paste
Quit Vi
A last word...
5. Command-Line Utilities
File Operations and Filtering
cat, tail, head, tee: File Printing Commands
grep: Locate Strings in Files
wc: Calculation Elements in Files
sort: Sorting Files
find: Find Files According to Certain Criteria
Commands Startup Sheduling
crontab: reporting or editing your crontab file
at: schedule a command, but only once
Archiving and Data Compression
tar: Tape ARchiver
bzip2 and gzip: Data Compression Programs
Many, many more...
6. Process Control
More About Processes
The Process Tree
Signals
Information on Processes: ps and pstree
ps
pstree
Sending Signals to Processes: kill, killall and top
kill, killall
Mixing ps and kill: top
Setting Priority to Processes: nice, renice
renice
nice