Ubuntu Linux Toolbox - Christopher Negus - E-Book

Ubuntu Linux Toolbox E-Book

Christopher Negus

0,0
19,99 €

oder
-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.
Mehr erfahren.
Beschreibung

This updated bestseller from Linux guru Chris Negus is packed with an array of new and revised material As a longstanding bestseller, Ubuntu Linux Toolbox has taught you how to get the most out Ubuntu, the world's most popular Linux distribution. With this anticipated new edition, Christopher Negus returns with a host of new and expanded coverage on tools for managing file systems, ways to connect to networks, techniques for securing Ubuntu systems, and a look at the latest Long Term Support (LTS) release of Ubuntu, all aimed at getting you up and running with Ubuntu Linux quickly. * Covers installation, configuration, shell primer, the desktop, administrations, servers, and security * Delves into coverage of popular applications for the web, productivity suites, and e-mail * Highlights setting up a server (Apache, Samba, CUPS) * Boasts a handy trim size so that you can take it with you on the go Ubuntu Linux Toolbox, Second Edition prepares you with a host of updated tools for today's environment, as well as expanded coverage on everything you know to confidently start using Ubuntu today.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 560

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Cover

Introduction

Ubuntu Takes Linux by Storm

Who Should Read This Book

What This Book Covers

How This Book Is Structured

What You Need to Use This Book

Conventions

Chapter 1: Starting with Ubuntu Linux

Ubuntu, Debian, and Linux

Finding Commands

Reference Information in Ubuntu

Summary

Chapter 2: Installing Ubuntu and Adding Software

Obtaining and Installing Ubuntu

Working with Debian Software Packages

Adding Software Collections with tasksel

Managing Software with APT

Finding Packages with APT

Managing Software with dpkg

Managing Software with aptitude

Verifying Installed Packages with debsums

Building deb Packages

Summary

Chapter 3: Using the Shell

Terminal Windows and Shell Access

Using the Shell

Acquiring Super User Power

Using Environment Variables

Creating Simple Shell Scripts

Summary

Chapter 4: Working with Files

Understanding File Types

Setting File/Directory Permissions

Traversing the Filesystem

Copying Files

Changing File Attributes

Searching for Files

Finding Out More about Files

Summary

Chapter 5: Manipulating Text

Matching Text with Regular Expressions

Editing Text Files

Listing, Sorting, and Changing Text

Summary

Chapter 6: Playing with Multimedia

Working with Audio

Transforming Images

Playing with Video

Summary

Chapter 7: Administering Filesystems

Understanding Filesystem Basics

Creating and Managing Filesystems

Mounting and Unmounting Filesystems

Checking Filesystems

Creating Encrypted Filesystems

Checking RAID Disks

Finding Out about Filesystem Use

Summary

Chapter 8: Backups and Removable Media

Backing Up Data to Compressed Archives

Backing Up over Networks

Summary

Chapter 9: Checking and Managing Running Processes

Listing Active Processes

Finding and Controlling Processes

Summary

Chapter 10: Managing the System

Monitoring Resources

Mastering Time

Managing the Boot Process

Controlling Startup and Run Levels

Straight to the Kernel

Poking at the Hardware

Summary

Chapter 11: Managing Network Connections

Configuring Networks from the GUI

Managing Network Interface Cards

Managing Network Connections

Using Wireless Connections

Checking Name Resolution

Troubleshooting Network Problems

Summary

Chapter 12: Accessing Network Resources

Running Commands to Browse the Web

Transferring Files

Sharing Remote Directories

Chatting with Friends in IRC

Using Text-Based E-mail Clients

Summary

Chapter 13: Doing Remote System Administration

Doing Remote Login and Tunneling with SSH

Using Legacy Communications Tools

Using byobu and screen for Remote Shells

Using a Remote Windows Desktop

Using Remote Linux Desktop and Applications

Sharing Desktops Using VNC

Summary

Chapter 14: Locking Down Security

Working with Users and Groups

Checking on Users

Configuring the Built-In Firewall

Using Advanced Security Features

Summary

Chapter 15: Setting Up a Virtualization Host and Virtual Machines

Can Your Computer Support Virtualization?

Managing Virtual Machines with virt-manager

Managing Virtual Machines with Commands

Summary

Appendix A: Using vi or Vim Editors

Starting and Quitting the vi Editor

Moving Around in vi

Changing and Deleting Text in vi

Using Miscellaneous Commands

Modifying Commands with Numbers

Using ex Commands

Working in Visual Mode

Appendix B: Shell Special Characters and Variables

Using Special Shell Characters

Using Shell Variables

Appendix C: Getting Information from /proc

Viewing /proc Information

Changing /proc Information

Introduction

The huge, enthusiastic Ubuntu community has swept up thousands and thousands of new Ubuntu Linux users. If you are one of them, you will probably soon find yourself wanting to dig beneath the surface of Ubuntu’s applications and graphical tools. You’ll want to become a power user.

Becoming a power user with any Linux system means being able to work from the command line. Few graphical interfaces will provide you with the options and flexibility you get with commands that address the same features.

Ubuntu Linux Toolbox provides you with more than 1000 specific command lines to help you dig deeply into Linux. Whether you are a systems administrator or desktop user, the book will show you the commands to create file systems, troubleshoot networks, lock down security, and dig out almost anything you care to know about your Linux system.

This book’s focus for your Linux command-line journey is Ubuntu, the community-based Linux distribution sponsored by Canonical Ltd., and the Debian GNU/Linux system on which it is based. Tapping into the skills required to run those systems can help you to work with your own Linux systems as well as learn what you need to do as a Linux professional.

Ubuntu Takes Linux by Storm

Since its inaugural release in 2004, Ubuntu (www.ubuntu.com) has become the most popular and, arguably, best loved of the Linux distributions. From its name, which translates to humanity toward others, to its focus on support for many languages and special needs, Ubuntu has reflected its ideals of spreading free software beyond the standard Linux target markets of geeks and corporate servers.

The Ubuntu project does everything it can to help ease new users into using its Linux-based Ubuntu operating system. Ubuntu live CDs let a new user try out Ubuntu before installing it. If the user likes Ubuntu, a single click can start an Ubuntu install to hard disk. And because Ubuntu is based on Debian GNU/Linux, Ubuntu has made massive amounts of software from the Debian software repositories available free to Ubuntu users.

Although it’s true that Ubuntu focuses on ease-of-use desktop systems, that doesn’t mean Ubuntu has no commercial Linux value. In fact, Canonical offers paid enterprise-quality support through its Landscape initiative (www.ubuntu.com/management). Canonical also offers a range of free and paid support options for individuals and small businesses (www.ubuntu.com/support). In other words, there are professional opportunities for those who learn to operate Ubuntu.

Who Should Read This Book

This book is for anyone who wants to access the power of a Linux system as a systems administrator or user. You may be a Linux enthusiast, a Linux professional, or possibly a computer professional who is increasingly finding the Windows systems in your data center supplanted by Linux boxes.

The bottom line is that you want to find quick and efficient ways of getting Ubuntu and other Debian-based systems working at peak performance. Those systems may be a few desktop systems at work, a file and print server at your school, or a home web server that you’re doing just for fun.

In the best case, you should already have some experience with Linux. However, if you are a computer professional with skills managing other types of operating systems, such as Windows, you can easily adapt your knowledge to use the specific commands I cover in the book.

What This Book Covers

This is not a beginner’s Linux book. Before you jump in, it would be best if you have a basic working knowledge of what Linux is, how the shell works, and what processes, filesystems, and network interfaces are. The book will then supplement that knowledge with information you need to do the following activities:

Get software

Ubuntu offers the Ubuntu Software Center GUI tool for getting software. With tools such as

apt-get

, you’ll learn the best ways to search for, download, install, update, and otherwise manage software from the command line.

Use the shell

Find neat techniques and tips for using the shell.

Play with multimedia

Play and stream multimedia content from your computer. You can also modify audio and image files, and then convert the content of those files to different formats. For video, you can play a variety of video formats, including commercial movies.

Work with files

Use, manipulate, convert, and secure a wide range of file types in Linux.

Administer file systems

Access, format, partition, and monitor your file storage hardware (hard disks, CD/DVD drives, floppy disks, USB flash drives, and so on). Then create, format, and check the file systems that exist on those hardware devices. You can even create encrypted file systems to protect your data.

Back up and restore data

Use simple commands to gather, archive, and compress your files into efficient backup archives. Then store those archives locally or on remote computers.

Work with processes

List running processes in a variety of ways, such as by CPU use, processor use, or process ID. Then change running processes to have them run in the background or foreground. Send signals to processes to have them re-read configuration files, stop and resume processing, or stop completely (abort).

Manage the system

Run commands to check system resources, such as memory usage, runlevels, boot loaders, and kernel modules.

Monitor networks

Bring wired and wireless network connections up and down. Check routing, DNS, and host information. Keep an eye on network traffic.

Get network resources

Connect to Linux and Windows remote file systems using FTP, NFS, and Samba facilities. Use shell-based commands to browse the web.

Do remote administration

Access and administer other computers using remote login (

ssh

,

telnet

, and so on), and screen. Learn about remote administration interfaces, such as Webmin, SWAT, and CUPS.

Lock down security

Set up firewalls and system logging to secure your Linux systems.

Set up a virtualization host

Configure your Ubuntu system as a host KVM system, then install and manage virtual machines on that host.

Get reference information

Use the appendixes at the end of this book to get more information about the shell (such as metacharacters and shell variables) and the state of the system (from

/proc

).

Hopefully, if I have done it right, it will be easier to use this book than to Google for the command lines or GUI tools you need.

After you have mastered many of the features described in this book, you’ll have gained the following advantages:

Hundreds of commands

By compressing a lot of information into a small space, you will have access to hundreds of useful commands, in over 1000 command lines, in a handy form to carry with you.

Critical Linux information

This book lists connections to the most critical information on the web for succeeding with Linux in general and Ubuntu in particular.

Transferable knowledge

Most of the same commands and options you use in Ubuntu will work exactly the same way on other Debian-based Linux systems. Different Linux distributions, on the other hand, offer different graphical administration tools. And even within a particular distribution, graphical tools change more often than commands do.

Quick problem solving

By the time others have started up a desktop and launched a graphical administration tool, you will have already run a half dozen commands and solved the problem.

Enduring value

Many of the commands described in this book were used in early Unix systems. So you are gaining tools that reflect the experience of thousands of computer experts for more than 40 years.

Because the full documentation for commands used in Linux consists of thousands of man pages, info text, and help messages, you will surely want to reach beyond the pages of this book from time to time. Luckily, Ubuntu and other Linux systems include helpful information installed on the system itself. Chapter 1 contains descriptions of how to access that information that is probably already installed on your Ubuntu system.

How This Book Is Structured

This book is neither a pure reference book (with alphabetically listed components) nor a guide (with step-by-step procedures for doing tasks). Instead, the book is organized by topics and aimed at including as many useful commands and options as I could fit.

Chapter 1 starts by giving you a basic understanding of what Ubuntu is and how it relates to other Linux systems, such as various Debian-based distributions. Then it describes some of the vast resources available to support your experience with this book (such as man pages, info material, and help text). Chapter 2 provides a quick overview of installation and then describes useful commands such as apt-get for getting and managing your Ubuntu software.

Commands that a regular user may find useful in Linux are described in Chapters 3, 4, 5, and 6. Chapter 3 describes tools for using the shell, Chapter 4 covers commands for working with files, and Chapter 5 describes how to manipulate text. Chapter 6 tells how to work with music, image, and video files.

Starting with Chapter 7, you get into topics relating to system administration. Creating and checking filesystems are covered in Chapter 7, while commands for doing data backups are described in Chapter 8. Chapter 9 describes how to manipulate running processes, and Chapter 10 describes administrative tools for managing basic components, such as hardware modules, CPU use, and memory use.

Chapter 11 is devoted to managing network resources by describing how to set up and work with wired and wireless network interfaces. Chapter 12 covers text-based commands for web browsing, file transfer, file sharing, chats, and e-mail. Tools for doing remote system administration are included in Chapter 13.

Chapter 14 tells you how to lock down security using features such as firewalls and logging. Chapter 15 describes how you can configure Ubuntu as a KVM virtualization host, then use GUI and command-line tools to install virtual machines and manage them from your Ubuntu KVM host.

After that, three appendixes provide reference information for text editing, shell features (metacharacters and variables), and system settings (from the /proc file system).

What You Need to Use This Book

Although I hope you enjoy the beauty of my prose, this is not meant to be a book you curl up with in front of a nice fire with a glass of wine. I expect you will be sitting in front of a computer screen trying to connect to a network, fix a file system, or add a user. The wine is optional.

In other words, the book is meant to be a companion as you work on an Ubuntu or Debian operating system. If you don’t already have an Ubuntu or Debian system installed, refer to Chapter 2 for information on getting and installing those systems.

All the commands in this book have been tested against Ubuntu on x86 or x86_64 architecture. However, because many of these commands have been around for a long time (some dating back over 30 years to the original UNIX days), most will work exactly as described here on Debian systems, regardless of CPU architecture.

Many of the commands described in this book will work on other Linux and Unix systems as well. Because this book focuses on Ubuntu, descriptions will differ from other Linux systems most prominently in the areas of packaging, installation, the boot process, and GUI administration tools.

To give this book the longest useful life, I have focused on the latest Ubuntu Long Term Support (LTS) release: Ubuntu 12.04. Support for that release is offered until 2019.

Conventions

To help you get the most from the text and keep track of what’s happening, I’ve used a number of conventions throughout the book. In particular, I’ve created styles for showing commands that allowed me to fit as many command lines as possible in the book.

With command examples, computer output (shell prompts and messages) is shown in regular monofont text, computer input (the stuff you type) is shown in bold monofont text, and a short description (if included) appears in italics. Here is an example:

$

ls *jpg

List all JPEG files in the current directory

hat.jpg dog.jpg ...

To save space, output is sometimes truncated (or skipped altogether). Three dots (...) are used to indicate that additional output was cut. If a command is particularly long, backslashes will appear at the end of each line to indicate that input is continuing to the next line. Here is an example:

#

oggenc NewSong.wav -o NewSong.ogg \

-a Bernstein -G Classical \

-d 06/15/1972 -t "Simple Song" \

-l "Bernsteins Mass" \

-c info="From Kennedy Center"

In the example just shown, you can literally type the backslashes to have all that information included in the single command. Or, you can simply put all the information on a single line, excluding the backslashes.

Although a regular user can run many commands in Ubuntu, to run some commands, the user must have root privilege. Because Ubuntu is installed without a root password, you are expected to use the sudo command from an Ubuntu user session to run administrative commands. Here’s an example:

chris@host1:/tmp$

sudo useradd -m joe

For clarity, and to save space, I typically show a regular user prompt as simply a dollar sign ($):

$

Indicates a regular user prompt

On occasion, you will also see a pound sign prompt (#), indicating that you probably need to run the command with root privilege. So, if you see a # prompt you can either type the sudo command in front of the command line or gain root privilege using one of the ways described in Chapter 3.

Notes and warnings appear as follows:

Note Warnings, notes, and tips are offset and placed in italic like this.

As for styles in the text:

I

italicize

new terms and important words with italics when we introduce them.

I show keyboard combinations like this: Ctrl+a. If the command requires you to type an uppercase letter, the combination will show this: Ctrl+Shift+a.

I show file names, URLs, and code within the text like so:

persistence.properties

.

One final technique I use is to highlight text that describes what an upcoming command is meant to do. For example, I may say something like, “use the following command to display the contents of a file.” Highlighting descriptions in this way is done to provide quick visual cues to the readers, so you can easily scan the page for that command you just knew had to be there.

Chapter 1

Starting with Ubuntu Linux

IN THIS CHAPTER

Introducing Ubuntu Linux

Finding Ubuntu resources

Learning quick and powerful commands

Referencing useful utilities

Working as Linux gurus do

Whether you make extensive use of Ubuntu Linux at work every day, or just putter around with it once in a while, a book that presents efficient and comprehensive ways to maintain, monitor, secure, and enhance Ubuntu can be an invaluable resource.

Ubuntu Linux Toolbox, Second Edition is that resource.

Ubuntu Linux Toolbox, Second Edition is aimed primarily at power users and systems administrators. To give you what you need, I will show you how to quickly find and install software for Ubuntu, as well as how to update, maintain, and monitor the health and security of your system. In short, I will show you the most efficient ways of using Ubuntu by working with some of the powerful tools that are at your fingertips.

The goal of this book is to pack as much useful information as possible into a small package that you can carry around with you. To that end, I describe:

Commands

—Tons of command line examples demonstrate clever and useful ways to navigate the often daunting command line.

GUI tools

—Quick tips for using graphical interface tools to administer and configure your Ubuntu system.

Software repositories

—Methods for downloading and installing the software, which is custom-made for your Ubuntu system.

Online resources

—Where to find useful and helpful information about Ubuntu, such as mailing lists that you can subscribe to, IRC channels, and other online resources.

Local documentation

—Tools for working with the man pages, the standard Linux and UNIX reference volumes, as well as specific documentation for the software you install.

Because this book is for people already familiar with Linux, there won’t be a lot of screenshots of icons and menus. What you get instead is the quickest path to using your Ubuntu system to its fullest extent. Primarily, that means unlocking the mysteries of the command line to do things you can only dream about doing from the desktop.

What you learn in this book will help you become more adept at working with your Ubuntu or Debian system, as well as Linux in general. If this sounds useful to you, please read on.

Ubuntu, Debian, and Linux

Ubuntu is an operating system based on Debian GNU/Linux (www.debian.org). Debian has been around since the early 1990s, and because of its maturity, is regarded as a leading Linux distribution in terms of stability and security. Debian is also known for its strict adherence to free software (www.debian.org/intro/free). It is on this foundation that Ubuntu has been formed.

Debian has given rise to not only Ubuntu, but many other Linux distributions (www.debian.org/misc/children-distros). Some are derived directly from Debian, while others are Ubuntu derivatives:

Xubuntu

—An Xfce-based desktop system based on Ubuntu

Kubuntu

—A KDE-based desktop system based on Ubuntu

Edubuntu

—An Ubuntu derivative focused on schools

Linux Mint

—An easy-to-use desktop system with both Ubuntu and Debian roots

Knoppix

—A KDE desktop-oriented live CD based on Debian

Kanotix

—A Debian-based live CD

Damn Small Linux

—A tiny (50MB) live CD based on Knoppix

Mepis

—A desktop live CD based on Ubuntu and Debian

Xubuntu, Kubuntu, and Edubuntu are the same Debian-based Ubuntu distribution under the hood. The only difference in these is the default desktop they run, or the collection of applications bundled with them. For example, Kubuntu features the KDE desktop and Adept package manager, which are not installed on Ubuntu by default. Edubuntu is geared toward educational applications, many of which are not installed by default on the other Ubuntu distros.

Because Debian and Ubuntu are open source systems with most parts built on the GNU General Public License (www.gnu.org/copyleft/gpl.html), anyone is free to take the GPL-based source code, or any part of the GPL’d system, and modify, strip down, build upon, extend, embed, reverse-engineer, and freely distribute those changes or modifications. Generally, the only requirement is that you abide by the terms of the GPL, which basically states that any changes you make to existing GPL works must be made available for others to utilize in the same way (see www.debian.org/social_contract for other licenses Debian recognizes).

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!