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 worlds 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 todays environment, as well as expanded coverage on everything you know to confidently start using Ubuntu today. Contents 13 Introduction 21 Chapter 1: Starting with Ubuntu Linux 27 Ubuntu, Debian, and Linux 28 Understanding Ubuntu Releases 29 Ubuntu Compared to Other Linux Distributions 29 Finding Ubuntu Resources 31 Ubuntu Software 33 Focusing on Linux Commands 33 Finding Commands 35 Reference Information in Ubuntu 37 Using help Messages 38 Using man Pages 38 Using info Documents 41 Summary 41 Chapter 2: Installing Ubuntu and Adding Software 43 Obtaining and Installing Ubuntu 43 Preparing to Install 44 Choosing Installation Options 45 Answering Installation Questions 45 Working with Debian Software Packages 46 Working with Software Packages 48 Enabling More Repositories for apt 49 Adding Software Collections with tasksel 50 Managing Software with APT 51 Finding Packages with APT 53 Installing Packages with APT 53 Upgrading Packages with APT 54 Upgrading a Single Package with APT 54 Removing Packages with APT 55 Cleaning Up Packages with APT 55 Downloading Packages with APT 56 Managing Software with dpkg 56 Installing a Package with dpkg 58 Removing a Package with dpkg 58 Extracting Files from a .deb File with dpkg 58 Querying Information about .deb Packages 59 Managing Software with aptitude 61 Updating and Upgrading Packages with aptitude 63 Querying Information about Packages with aptitude 63 Installing Packages with aptitude 64 Removing Packages with aptitude 64 Cleaning Up Packages with aptitude 65 Useful Combinations of Options with aptitude 65 Verifying Installed Packages with debsums 67 Building deb Packages 70 Summary 73 Chapter 3: Using the Shell 75 Terminal Windows and Shell Access 75 Using Terminal Windows 75 Using Virtual Consoles 77 Using the Shell 78 Using Bash History 79 Using Command Line Completion 80 Redirecting stdin and stdout 80 Using alias 83 Watching Commands 84 Watching Files 84 Acquiring Super User Power 84 Delegating Power with sudo 85 Using the su Command 87 Using Environment Variables 88 Creating Simple Shell Scripts 90 Editing and Running a Script 90 Adding Content to Your Script 91 Summary 94 Chapter 4: Working with Files 95 Understanding File Types 95 Using Regular Files 95 Using Directories 97 Using Symbolic and Hard Links 97 Using Device Files 98 Using Named Pipes and Sockets 99 Setting File/Directory Permissions 99 Changing Permissions with chmod 100 Setting the umask 102 Changing Ownership 102 Traversing the Filesystem 103 Copying Files 105 Changing File Attributes 106 Searching for Files 108 Finding Files with locate 108 Locating Files with find 109 Using Other Commands to Find Files 111 Finding Out More about Files 112 Listing Files 112 Verifying Files 112 Summary 114 Chapter 5: Manipulating Text 115 Matching Text with Regular Expressions 115 Editing Text Files 116 Using the JOE Editor 117 Using the Pico and nano Editors 118 Graphical Text Editors 120 Listing, Sorting, and Changing Text 120 Listing Text Files 120 Paging through Text 121 Paginating Text Files with pr 122 Searching for Text with grep 123 Replacing Text with sed 125 Translating or Removing Characters with tr 127 Checking Differences between Two Files with diff 127 Using awk and cut to Process Columns 130 Converting Text Files to Different Formats 131 Summary 131 Chapter 6: Playing with Multimedia 133 Working with Audio 133 Playing Music 133 Adjusting Audio Levels 135 Ripping CD Music 136 Encoding Music 137 Streaming Music 140 Converting Audio Files 142 Transforming Images 143 Getting Information about Images 143 Converting Images 144 Converting Images in Batches 145 Playing with Video 147 Playing Video Files 147 Summary 149 Chapter 7: Administering Filesystems 151 Understanding Filesystem Basics 151 Creating and Managing Filesystems 153 Partitioning Hard Disks 153 Working with Filesystem Labels 157 Formatting a Filesystem 158 Viewing and Changing Filesystem Attributes 159 Creating and Using Swap Partitions 161 Mounting and Unmounting Filesystems 162 Mounting Filesystems from the fstab File 162 Mounting Filesystems with the mount Command 164 Unmounting Filesystems with umount 166 Checking Filesystems 167 Creating Encrypted Filesystems 169 Checking RAID Disks 172 Finding Out about Filesystem Use 173 Logical Volume Manager 175 Creating LVM Volumes 175 Using LVM Volumes 177 Growing the LVM Volume 178 Shrinking an LVM Volume 179 Removing LVM Logical Volumes and Groups 179 Summary 180 Chapter 8: Backups and Removable Media 181 Backing Up Data to Compressed Archives 181 Creating Backup Archives with tar 181 Using Compression Tools 183 Listing, Joining, and Adding Files to tar Archives 186 Deleting Files from tar Archives 186 Backing Up over Networks 187 Backing Up tar Archives over ssh 187 Backing Up Files with rsync 188 Backing Up with unison 190 Backing Up to Removable Media 191 Creating Backup Images with mkisofs 191 Burning Backup Images with cdrecord 194 Making and Burning DVDs with growisofs 196 Summary 196 Chapter 9: Checking and Managing Running Processes 197 Listing Active Processes 198 Viewing Active Processes with ps 198 Watching Active Processes with top 203 Finding and Controlling Processes 205 Using pgrep to Find Processes 205 Using fuser to Find Processes 206 Changing Running Processes 207 Scheduling Realtime Processes 214 Summary 215 Chapter 10: Managing the System 217 Monitoring Resources 217 Monitoring Memory Use 218 Monitoring CPU Usage 222 Monitoring Storage Devices 224 Mastering Time 227 Changing Time/Date with Graphical Tools 227 Displaying and Setting Your System Clock 228 Displaying and Setting Your Hardware Clock 229 Using Network Time Protocol to Set Date/Time 230 Managing the Boot Process 231 Understanding the GRUB Boot Loader 231 Modifying the GRUB Boot Loader 232 Controlling Startup and Run Levels 233 Straight to the Kernel 235 Poking at the Hardware 237 Summary 239 Chapter 11: Managing Network Connections 241 Configuring Networks from the GUI 241 Managing Network Interface Cards 242 Managing Network Connections 247 Starting and Stopping Ethernet Connections 247 Viewing Ethernet Connection Information 249 Using Wireless Connections 251 Checking Name Resolution 252 Troubleshooting Network Problems 254 Checking Connectivity to a Host 254 Checking Address Resolution Protocol 255 Tracing Routes to Hosts 257 Displaying netstat Connections and Statistics 259 Other Useful Network Tools 260 Summary 261 Chapter 12: Accessing Network Resources 263 Running Commands to Browse the Web 263 Transferring Files 265 Downloading Files with wget 265 Transferring Files with cURL 267 Transferring Files with FTP Commands 267 Using SSH Tools to Transfer Files 269 Using Windows File Transfer Tools 272 Sharing Remote Directories 272 Sharing Remote Directories with NFS 272 Sharing Remote Directories with Samba 274 Sharing Remote Directories with SSHFS 277 Chatting with Friends in IRC 278 Using Text-Based E‐mail Clients 279 Managing E‐mail with mail 280 Managing E‐mail with mutt 282 Summary 283 Chapter 13: Doing Remote System Administration 285 Doing Remote Login and Tunneling with SSH 285 Using Legacy Communications Tools 286 Configuring SSH 287 Logging in Remotely with ssh 288 Using byobu and screen for Remote Shells 293 Managing Remote Shells with Screen 294 Using byobu to Manage Remote Shells 296 Using a Remote Windows Desktop 298 Connecting to a Windows Desktop with Remmina 298 Connecting to a Windows Desktop with rdesktop 300 Using Remote Linux Desktop and Applications 300 Sharing Desktops Using VNC 301 Setting Up the VNC Server 302 Starting Up the VNC Client 303 Using VNC on Untrusted Networks with SSH 303 Summary 304 Chapter 14: Locking Down Security 305 Working with Users and Groups 305 Managing Users the GUI Way 306 Adding User Accounts 306 Changing useradd Defaults 307 Modifying User Accounts 308 Deleting User Accounts 309 Managing Passwords 309 Adding Groups 312 Checking on Users 312 Configuring the Built-In Firewall 314 Understanding iptables Firewalls 315 Listing iptables Rules 317 Setting Other Firewall Rules 318 Saving and Reloading Firewall Rules 320 Using Advanced Security Features 320 Summary 321 Chapter 15: Setting Up a Virtualization Host 323 Can Your Computer Support Virtualization? 324 Checking for CPU Virtualization Support 324 Enabling Virtualization Support in the BIOS 325 Is the Host Computer 32- or 64-Bit? 326 Checking Available RAM and Disk Space 326 Adding Virtualization Software 327 Adding Your User Account to libvirtd 328 Managing Virtual Machines with virt-manager 328 Creating a Virtual Machine in virt-manager 330 Starting and Stopping Virtual Machines with virt-manager 331 Managing Virtual Machines with Commands 332 Creating a Virtual Machine with virt-install 332 Starting and Stopping Virtual Machines with virsh 334 Summary 335 Appendix A: Using vi or Vim Editors 337 Starting and Quitting the vi Editor 337 Moving Around in vi 339 Changing and Deleting Text in vi 340 Using Miscellaneous Commands 340 Modifying Commands with Numbers 341 Using ex Commands 341 Working in Visual Mode 342 Appendix B: Shell Special Characters and Variables 343 Using Special Shell Characters 343 Using Shell Variables 344 Appendix C: Getting Information 347 Viewing /proc Information 347 Changing /proc Information 351 Index 353 In this handy, compact guide, you'll explore a ton of powerful Ubuntu Linux commands while you learn to use Ubuntu Linux as the experts do: from the command line. Try out more than 1,000 commands to find and get software, monitor system health and security, and access network resources. Then, apply the skills you learn from this book to use and administer desktops and servers running Ubuntu, Debian, and KNOPPIX or any other Linux distribution.