You are previewing Fedora® Linux® TOOLBOX: 1000+ Commands for Fedora, CentOS, and Red Hat® Power Users.
O'Reilly logo
Fedora® Linux® TOOLBOX: 1000+ Commands for Fedora, CentOS, and Red Hat® Power Users

Book Description

In this handy, compact guide, you'll explore a ton of powerful Fedora Linux commands while you learn to use Fedora 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 Fedora, CentOS, Red Hat Enterprise Linux, or any other Linux distribution.

Table of Contents

  1. Copyright
  2. About the Authors
  3. Credits
  4. Acknowledgments
  5. Introduction
    1. Who Should Read This Book
    2. What This Book Covers
    3. How This Book Is Structured
    4. What You Need to Use This Book
    5. Conventions
  6. 1. Starting with Fedora Linux
    1. 1.1. About Fedora, Red Hat, and Linux
      1. 1.1.1. Comparing Fedora to Other Linuxes
      2. 1.1.2. Finding Fedora Resources
        1. 1.1.2.1. Fedora Community Connections
        2. 1.1.2.2. Fedora Software
    2. 1.2. Focusing on Linux Commands
      1. 1.2.1. Finding Commands
      2. 1.2.2. Command Reference Information in Fedora
        1. 1.2.2.1. Using help Messages
        2. 1.2.2.2. Using man Pages
        3. 1.2.2.3. Using info Documents
    3. 1.3. Summary
  7. 2. Installing Fedora and Adding Software
    1. 2.1. Installing Fedora
      1. 2.1.1. Preparing to Install
      2. 2.1.2. Choosing Installation Options
        1. 2.1.2.1. Starting the Install Process
        2. 2.1.2.2. Choosing Where Fedora Software Is from the Boot Screen
        3. 2.1.2.3. Choosing How Install Proceeds from the Boot Screen
        4. 2.1.2.4. Choosing More Boot Options
      3. 2.1.3. Answering Installation Questions
    2. 2.2. Working with Software Packages
    3. 2.3. Using yum Software Repositories
      1. 2.3.1. Enabling Repositories for yum
      2. 2.3.2. Using the yum Command
        1. 2.3.2.1. Finding Packages
        2. 2.3.2.2. Installing Packages
        3. 2.3.2.3. Updating Packages
        4. 2.3.2.4. Removing Packages
        5. 2.3.2.5. Cleaning Up Packages
        6. 2.3.2.6. Useful Combinations of Options
      3. 2.3.3. Using yum Utilities
    4. 2.4. Managing Software with rpm
      1. 2.4.1. Using the rpm Command
        1. 2.4.1.1. Installing a Package
        2. 2.4.1.2. Upgrading a Package
        3. 2.4.1.3. Removing a Package
        4. 2.4.1.4. Querying Information about RPM Packages
        5. 2.4.1.5. Verifying Installed Packages
        6. 2.4.1.6. Rebuilding Your RPM Database
      2. 2.4.2. Building RPMs from SRPMs
      3. 2.4.3. Extracting Files from RPMs
    5. 2.5. Summary
  8. 3. Using the Shell
    1. 3.1. Terminal Windows and Shell Access
      1. 3.1.1. Using Terminal Windows
      2. 3.1.2. Using Virtual Terminals
    2. 3.2. Using the Shell
      1. 3.2.1. Using Bash History
      2. 3.2.2. Using Command Line Completion
      3. 3.2.3. Redirecting stdin and stdout
      4. 3.2.4. Using alias
      5. 3.2.5. Watching Commands
      6. 3.2.6. Watching Files
    3. 3.3. Acquiring Super User Power
      1. 3.3.1. Using the su Command
      2. 3.3.2. Delegating Power with sudo
    4. 3.4. Using Environment Variables
    5. 3.5. Creating Simple Shell Scripts
      1. 3.5.1. Editing and Running a Script
      2. 3.5.2. Adding Content to Your Script
    6. 3.6. Summary
  9. 4. Working with Files
    1. 4.1. Understanding File Types
      1. 4.1.1. Using Regular Files
      2. 4.1.2. Using Directories
      3. 4.1.3. Using Symbolic and Hard Links
      4. 4.1.4. Using Device Files
      5. 4.1.5. Using Named Pipes and Sockets
    2. 4.2. Setting File/Directory Permissions
      1. 4.2.1. Changing Permissions with chmod
      2. 4.2.2. Setting the umask
      3. 4.2.3. Changing Ownership
    3. 4.3. Traversing the File System
    4. 4.4. Copying Files
    5. 4.5. Changing File Attributes
    6. 4.6. Searching for Files
      1. 4.6.1. Finding Files with locate
      2. 4.6.2. Locating Files with find
      3. 4.6.3. Using Other Commands to Find Files
    7. 4.7. Finding Out More About Files
      1. 4.7.1. Listing Files
      2. 4.7.2. Verifying Files
    8. 4.8. Summary
  10. 5. Manipulating Text
    1. 5.1. Matching Text with Regular Expressions
    2. 5.2. Editing Text Files
      1. 5.2.1. Using the JOE Editor
      2. 5.2.2. Using the pico and nano Editors
      3. 5.2.3. Graphical Text Editors
    3. 5.3. Listing, Sorting, and Changing Text
      1. 5.3.1. Listing Text Files
      2. 5.3.2. Paging Through Text
      3. 5.3.3. Paginating Text Files with pr
      4. 5.3.4. Searching for Text with grep
        1. 5.3.4.1. Checking Word Counts with wc
        2. 5.3.4.2. Sorting Output with sort
        3. 5.3.4.3. Finding Text in Binaries with Strings
      5. 5.3.5. Replacing Text with sed
      6. 5.3.6. Translating or Removing Characters with tr
      7. 5.3.7. Checking Differences Between Two Files with diff
      8. 5.3.8. Using awk and cut to Process Columns
      9. 5.3.9. Converting Text Files to Different Formats
    4. 5.4. Summary
  11. 6. Playing with Multimedia
    1. 6.1. Working with Audio
      1. 6.1.1. Playing Music
      2. 6.1.2. Adjusting Audio Levels
      3. 6.1.3. Ripping CD Music
      4. 6.1.4. Encoding Music
      5. 6.1.5. Streaming Music
      6. 6.1.6. Converting Audio Files
    2. 6.2. Transforming Images
      1. 6.2.1. Getting Information about Images
      2. 6.2.2. Converting Images
      3. 6.2.3. Converting Images in Batches
    3. 6.3. Summary
  12. 7. Administering File Systems
    1. 7.1. Understanding File System Basics
    2. 7.2. Creating and Managing File Systems
      1. 7.2.1. Partitioning Hard Disks
        1. 7.2.1.1. Changing Disk Partitions with fdisk
        2. 7.2.1.2. Copying Partition Tables with s fdisk
        3. 7.2.1.3. Changing Disk Partitions with parted
      2. 7.2.2. Working with File System Labels
      3. 7.2.3. Formatting a File System
        1. 7.2.3.1. Creating a File System on a Hard Disk Partition
        2. 7.2.3.2. Creating a Virtual File System
      4. 7.2.4. Viewing and Changing File System Attributes
      5. 7.2.5. Creating and Using Swap Partitions
    3. 7.3. Mounting and Unmounting File Systems
      1. 7.3.1. Mounting File Systems from the fstab File
      2. 7.3.2. Mounting File Systems with the mount Command
      3. 7.3.3. Unmounting File Systems with umount
    4. 7.4. Checking File Systems
    5. 7.5. Checking RAID Disks
    6. 7.6. Finding Out About File System Use
      1. 7.6.1. Logical Volume Manager
      2. 7.6.2. Creating LVM Volumes
      3. 7.6.3. Using LVM Volumes
      4. 7.6.4. Growing the LVM Volume
      5. 7.6.5. Shrinking an LVM Volume
      6. 7.6.6. Removing LVM Logical Volumes and Groups
    7. 7.7. Summary
  13. 8. Backups and Removable Media
    1. 8.1. Backing Up Data to Compressed Archives
      1. 8.1.1. Creating Backup Archives with tar
      2. 8.1.2. Using Compression Tools
        1. 8.1.2.1. Compressing with gzip
        2. 8.1.2.2. Compressing with bzip2
        3. 8.1.2.3. Compressing with lzop
      3. 8.1.3. Listing, Joining, and Adding Files to tar Archives
      4. 8.1.4. Deleting Files from tar Archives
    2. 8.2. Backing Up Over Networks
      1. 8.2.1. Backing Up tar Archives Over ssh
      2. 8.2.2. Backing Up Files with rsync
      3. 8.2.3. Backing Up with unison
      4. 8.2.4. Backing Up to Removable Media
      5. 8.2.5. Creating Backup Images with mkisofs
      6. 8.2.6. Burning Backup Images with cdrecord
      7. 8.2.7. Making and Burning DVDs with growisofs
    3. 8.3. Summary
  14. 9. Checking and Managing Running Processes
    1. 9.1. Listing Active Processes
      1. 9.1.1. Viewing Active Processes with ps
      2. 9.1.2. Watching Active Processes with top
    2. 9.2. Finding and Controlling Processes
      1. 9.2.1. Using pgrep to Find Processes
      2. 9.2.2. Using fuser to Find Processes
      3. 9.2.3. Changing Running Processes
        1. 9.2.3.1. Adjusting Processor Priority with nice
        2. 9.2.3.2. Running Processes in the Background and Foreground
        3. 9.2.3.3. Killing and Signaling Processes
        4. 9.2.3.4. Running Processes Away from the Current Shell
        5. 9.2.3.5. Scheduling Processes to Run
    3. 9.3. Summary
  15. 10. Managing the System
    1. 10.1. Monitoring Resources
      1. 10.1.1. Monitoring Memory Use
      2. 10.1.2. Monitoring CPU Usage
      3. 10.1.3. Monitoring Storage Devices
    2. 10.2. Mastering Time
      1. 10.2.1. Changing Time/Date with Graphical Tools
      2. 10.2.2. Displaying and Setting Your System Clock
      3. 10.2.3. Displaying and Setting Your Hardware Clock
      4. 10.2.4. Using Network Time Protocol to Set Date/Time
      5. 10.2.5. Trying Other Date/Time Commands
    3. 10.3. Managing the Boot Process
      1. 10.3.1. Using the GRUB Boot Loader
      2. 10.3.2. Repairing the initial ramdisk (initrd)
    4. 10.4. Controlling Startup and Run Levels
    5. 10.5. Straight to the Kernel
    6. 10.6. Poking at the Hardware
    7. 10.7. Summary
  16. 11. Managing Network Connections
    1. 11.1. Configuring Networks from the GUI
    2. 11.2. Managing Network Interface Cards
    3. 11.3. Managing Network Connections
      1. 11.3.1. Starting and Stopping Ethernet Connections
      2. 11.3.2. Viewing Ethernet Connection Information
    4. 11.4. Using Wireless Connections
    5. 11.5. Using Dial-up Modems
    6. 11.6. Checking Name Resolution
    7. 11.7. Troubleshooting Network Problems
      1. 11.7.1. Checking Connectivity to a Host
      2. 11.7.2. Checking Address Resolution Protocol (ARP)
      3. 11.7.3. Tracing Routes to Hosts
      4. 11.7.4. Displaying netstat Connections and Statistics
      5. 11.7.5. Other Useful Network Tools
    8. 11.8. Summary
  17. 12. Accessing Network Resources
    1. 12.1. Running Commands to Browse the Web
    2. 12.2. Transferring Files
      1. 12.2.1. Downloading Files with wget
      2. 12.2.2. Transferring Files with cURL
      3. 12.2.3. Transfering Files with FTP Commands
      4. 12.2.4. Using SSH Tools to Transfer Files
        1. 12.2.4.1. Copying Remote Files with scp
        2. 12.2.4.2. Copying Remote Files in sftp and lftp Sessions
      5. 12.2.5. Using Windows File Transfer Tools
    3. 12.3. Sharing Remote Directories
      1. 12.3.1. Sharing Remote Directories with NFS
        1. 12.3.1.1. Viewing and Exporting NFS Shares
        2. 12.3.1.2. Mounting NFS Shares
      2. 12.3.2. Sharing Remote Directories with Samba
        1. 12.3.2.1. Viewing and Accessing Samba Shares
        2. 12.3.2.2. Mounting Samba Shares
        3. 12.3.2.3. Looking Up Samba Hosts
        4. 12.3.2.4. Checking Samba Configuration
      3. 12.3.3. Sharing Remote Directories with SSHFS
    4. 12.4. Chatting with Friends in IRC
    5. 12.5. Using Text-Based E-mail Clients
      1. 12.5.1. Managing E-mail with mail
      2. 12.5.2. Managing E-mail with mutt
    6. 12.6. Summary
  18. 13. Doing Remote System Administration
    1. 13.1. Doing Remote Login and Tunneling with SSH
      1. 13.1.1. Configuring SSH
      2. 13.1.2. Logging in Remotely with ssh
        1. 13.1.2.1. Accessing SSH on a Different Port
        2. 13.1.2.2. Using SSH to Do Tunneling (X11 Port Forwarding)
        3. 13.1.2.3. Tunneling for X11 Clients
        4. 13.1.2.4. Tunneling for CUPS Printing Remote Administration
        5. 13.1.2.5. Tunneling to an Internet Service
        6. 13.1.2.6. Using SSH as a SOCKS Proxy
        7. 13.1.2.7. Using ssh with Public Key Authentication
        8. 13.1.2.8. Using Public Key Logins
        9. 13.1.2.9. Saving Private Keys to Use from a USB Flash Drive
    2. 13.2. Using screen: A Rich Remote Shell
      1. 13.2.1.
        1. 13.2.1.1. Reconnecting to a screen Session
        2. 13.2.1.2. Naming screen Sessions
        3. 13.2.1.3. Sharing screen Sessions
    3. 13.3. Using a Remote Windows Desktop
      1. 13.3.1. Connecting to a Windows Desktop with tsclient
      2. 13.3.2. Connecting to a Windows Desktop with rdesktop
    4. 13.4. Using Remote Linux Desktop and Applications
    5. 13.5. Sharing Desktops Using VNC
      1. 13.5.1. Setting Up the VNC Server
      2. 13.5.2. Starting Up the VNC Client
      3. 13.5.3. Using VNC on Untrusted Networks with SSH
      4. 13.5.4. Sharing a VNC Desktop with Vino
    6. 13.6. Summary
  19. 14. Locking Down Security
    1. 14.1. Working with Users and Groups
      1. 14.1.1. Managing Users the GUI Way
      2. 14.1.2. Adding User Accounts
        1. 14.1.2.1. Changing useradd Defaults
      3. 14.1.3. Modifying User Accounts
      4. 14.1.4. Deleting User Accounts
      5. 14.1.5. Managing Passwords
      6. 14.1.6. Adding Groups
    2. 14.2. Checking on Users
    3. 14.3. Configuring the Built-In Firewall
    4. 14.4. Working with System Logs
    5. 14.5. Using Advanced Security Features
    6. 14.6. Summary
  20. A. Using vi or Vim Editors
    1. A.1. Starting and Quitting the vi Editor
    2. A.2. Moving Around in vi
    3. A.3. Changing and Deleting Text in vi
    4. A.4. Using Miscellaneous Commands
    5. A.5. Modifying Commands with Numbers
    6. A.6. Using Ex Commands
    7. A.7. Working in Visual Mode
  21. B. Shell Special Characters and Variables
    1. B.1. Using Special Shell Characters
    2. B.2. Using Shell Variables
  22. C. Getting Information from /proc
    1. C.1. Viewing /proc information
    2. C.2. Changing /proc information