You are previewing Linux Utilities Cookbook.
O'Reilly logo
Linux Utilities Cookbook

Book Description

Everything you need to know about Linux but were afraid to ask. This book will make you a master of the command line and teach you how to configure the network, write shell scripts, build a custom kernel, and much more.

  • Use the command line like a pro

  • Pick a suitable desktop environment

  • Learn to use files and directories efficiently

  • In Detail

    Linux is a stable, reliable and extremely powerful operating system. It has been around for many years, however, most people still don't know what it can do and the ways it is superior to other operating systems. Many people want to get started with Linux for greater control and security, but getting started can be time consuming and complicated.

    A practical, hands-on guide that provides you with a number of clear step-by-step examples to help you solve many of the questions that crop up when using an operating system you may not be familiar with.

    Presenting solutions to the most common Linux problems in a clear and concise way, this helpful guide starts with spicing up the terminal sessions by command retrieval and line editing, and shell prompt variables. We will then get to know the different desktops (GUIs) available for Linux systems and which is the best fit for you. We will then explore the world of managing files and directories, connectivity, and what to do when it goes wrong. We will also learn a range of skills, from creating and managing user accounts to securing your system, managing and limiting processes, and letting information flow from one process to another using pipes. Later, we will master disk management, working with scripts and automating tasks quickly, and finally, understand the need for a custom kernel and tips on how to build one.

    Based on the author's extensive experience, there is a section on best practices that every Linux user should be familiar with.

    Table of Contents

    1. Linux Utilities Cookbook
      1. Table of Contents
      2. Linux Utilities Cookbook
      3. Credits
      4. About the Author
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Errata
          2. Piracy
          3. Questions
      8. 1. Using the Terminal / Command Line
        1. Introduction
        2. Command retrieval and line editing
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Using history
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Filename auto-completion
          1. Getting ready
          2. How to do it...
        5. The shell prompt
          1. How to do it...
          2. There's more...
        6. Other environment variables
          1. How to do it...
          2. How it works...
        7. Using aliases
          1. How to do it...
          2. There's more...
        8. The .bashrc file
          1. How to do it...
        9. Dealing with blanks and special characters in filenames
          1. How to do it...
          2. There's more...
        10. Understanding the $? variable
          1. How to do it...
          2. How it works...
          3. There's more...
        11. Redirection and piping
          1. How to do it...
          2. There's more...
        12. Sending output from one terminal to another
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        13. Using the Screen program
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
      9. 2. The Desktop
        1. Introduction
        2. GNOME 2
          1. Getting ready
          2. How to do it...
          3. There's more...
        3. KDE desktop
          1. Getting ready
          2. How to do it...
          3. There's more...
        4. xfce
          1. Getting ready
          2. How to do it...
          3. There's more...
        5. LXDE
          1. Getting ready
          2. How to do it...
          3. There's more...
        6. Unity
          1. Getting ready
          2. How to do it...
          3. There's more...
        7. Mate
          1. Getting started
          2. How to do it...
          3. There's more...
      10. 3. Files and Directories
        1. Introduction
          1. Understanding inodes and the superblock
        2. Copying, removing, and updating files and directories
          1. Getting ready
          2. How to do it...
          3. There's more...
        3. Finding files using find and locate
          1. How to do it...
          2. There's more...
        4. Creating text files – vim, Emacs, and others
          1. Getting ready
          2. How to do it...
          3. There's more...
        5. Using the file command
          1. How to do it...
          2. There's more...
          3. How to do it...
        6. Using grep to find patterns
          1. Getting ready
          2. How to do it...
          3. There's more...
        7. Compressing files using ZIP and TAR
          1. Getting ready
          2. How to do it...
          3. There's more...
        8. Other helpful commands such as stat, sum, touch, and more
          1. How to do it...
          2. There's more...
      11. 4. Networking and the Internet
        1. Introduction
        2. Troubleshooting bad connections
          1. Getting ready
          2. How to do it...
          3. There's more...
        3. Copying files to another machine – FTP and SCP
          1. Getting ready
          2. How to do it...
          3. There's more...
        4. Logging into another machine – Telnet and Secure Shell
          1. Getting ready
          2. How to do it...
          3. There's more...
        5. Getting a web page without a browser – wget
          1. How to do it...
          2. There's more...
        6. Browsing the web – Firefox
          1. Getting ready
          2. How to do it...
          3. There's more...
        7. E-mail – Using a web mail program
          1. Getting ready
          2. How to do it...
          3. There's more...
        8. Running your own web server – httpd
          1. Getting ready
          2. How to do it...
          3. There's more...
        9. What is using that port? The /etc/services file
          1. How to do it...
          2. There's more...
        10. IPv4 versus IPv6
          1. How to do it...
          2. There's more...
      12. 5. Permissions, Access, and Security
        1. Introduction
        2. Creating and managing user accounts – useradd
          1. Getting ready
          2. How to do it...
          3. There’s more...
        3. Working with passwords
          1. How to do it...
          2. There’s more...
        4. Working with file permissions
          1. Getting ready
          2. How to do it...
          3. There’s more...
        5. Working with the firewalls and router settings
          1. How to do it...
          2. There’s more...
        6. Working with Secure Linux – SELinux
          1. Getting ready
          2. How to do it...
          3. There’s more...
        7. Using sudo to secure a system
          1. Getting ready...
          2. How to do it...
          3. There’s more...
        8. The /tmp directory
          1. How to do it...
          2. There’s more...
      13. 6. Processes
        1. Introduction
        2. Understanding processes
          1. How to do it…
          2. There’s more...
        3. Examining processes with ps
          1. How to do it...
          2. How it works...
          3. There’s more...
        4. Examining processes using top
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There’s more...
        5. Changing priorities with nice
          1. How to do it...
          2. There’s more...
        6. Observing a process using the /proc filesystem
          1. How to do it...
          2. There’s more...
      14. 7. Disks and Partitioning
        1. Introduction
        2. Using fdisk
          1. Getting ready
          2. How to do it...
          3. There’s more...
        3. Using mkfs to format a drive
          1. Getting ready
          2. How to do it...
        4. Using fsck to check the filesystem
          1. Getting ready
          2. How to do it...
          3. There’s more...
        5. Logical Volume Management (LVM)
          1. Getting ready
          2. How to do it...
          3. There’s more...
            1. Understanding different filesystems
      15. 8. Working with Scripts
        1. Introduction
        2. Removing text from a file
          1. How to do it...
            1. Script 1 – removing line numbers
          2. How it works…
          3. There's more...
        3. Using script parameters
          1. How to do it...
            1. Script 2 – parameters
          2. How it works…
          3. There's more...
        4. Coding a loop in a script
          1. How to do it...
            1. Script 3 - loops
          2. How it works...
          3. There's more...
        5. Backing up your system
          1. How to do it...
            1. Script 4 – making backups
          2. How it works...
        6. Locking a file for only one use at a time
          1. How to do it...
            1. Script 5 – file locking
          2. How it works...
        7. Getting introduced to Perl
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
      16. 9. Automating Tasks Using Cron
        1. Introduction
        2. Creating and running a crontab file
          1. Getting ready
          2. How to do it...
        3. Running a command every other week
          1. How to do it...
          2. How it works...
          3. There's more...
        4. Reporting the errors from a crontab file
          1. How to do it...
          2. There's more...
      17. 10. The Kernel
        1. Introduction
        2. A brief look at module commands
          1. How to do it...
          2. How it works...
          3. There's more...
        3. Building a kernel from kernel.org
          1. Getting ready
          2. How to do it...
        4. Using xconfig to modify the configuration
          1. Getting ready
          2. How to do it...
          3. There's more...
        5. Working with GRUB
          1. How to do it...
          2. How it works...
        6. Understanding GRUB 2
          1. How to do it...
          2. How it works...
          3. There's more...
      18. A. Linux Best Practices
        1. Introduction
        2. Root user versus normal user
        3. Running the GUI
        4. Creating, verifying, and storing backups
        5. Permissions and who you are
        6. Making backups in real time
        7. Environment variables and shells
        8. The best environment
        9. Using and monitoring a UPS
        10. Being careful when copying files
        11. Verifying archive files and using checksums
        12. Firewalls, router settings, and security
        13. What to do if you find an intrusion
        14. Spaces in filenames
        15. Using scripts and aliases to save time and effort
        16. Using scp and ssh with automatic authentication
        17. Saving history and taking screenshots
        18. Space on drives
        19. Being open to new ideas
      19. B. Finding Help
        1. Introduction
        2. Using man pages
        3. Using the info command
        4. Commands and the Usage section
        5. Local documentation directories
        6. Browsing the web to find help
        7. Distribution release notes
        8. Linux users' groups
        9. Internet Relay Chat (IRC)
      20. Index