Small, Sharp Software Tools

Book description

The command-line interface is making a comeback. That's because developers know that all the best features of your operating system are hidden behind a user interface designed to help average people use the computer. But you're not the average user, and the CLI is the most efficient way to get work done fast. Turn tedious chores into quick tasks: read and write files, manage complex directory hierarchies, perform network diagnostics, download files, work with APIs, and combine individual programs to create your own workflows. Put down that mouse, open the CLI, and take control of your software development environment.

No matter what language or platform you're using, you can use the CLI to create projects, run servers, and manage files. You can even create new tools that fit right in with grep, sed, awk, and xargs. You'll work with the Bash shell and the most common command-line utilities available on macOS, Windows 10, and many flavors of Linux.

Create files without opening a text editor. Manage complex directory strutures and move around your entire file system without touching the mouse. Diagnose network issues and interact with APIs. Chain several commands together to transform data, and create your own scripts to automate repetitive tasks. Make things even faster by customizing your environment, creating shortcuts, and integrating other tools into your environment. Hands-on activities and exercises will cement your newfound knowledge and give you the confidence to use the CLI to its fullest potential. And if you're worried you'll wreck your system, this book walks you through creating an Ubuntu virtual machine so you can practice worry-free.

Dive into the CLI and join the thousands of other devs who use it every day.

What You Need:

You'll need macOS, Windows 10, or a Linux distribution like Ubuntu, Fedora, CentOS, or Debian using the Bash shell.

Publisher resources

View/Submit Errata

Table of contents

  1.  Acknowledgments
  2.  Preface
    1. A Tale of Many CLIs
    2. What’s In (and not in) This Book
    3. How to Use This Book
    4. Online Resources
  3. 1. Getting Your Feet Wet
    1. Accessing the Command-Line Interface
    2. Getting Your Bearings
    3. Creating and Reading Files
    4. Redirecting Streams of Text
    5. Creating Directories
    6. Going Home
    7. Using Autocompletion
    8. Elevating Privileges
    9. Installing Additional Programs with a Package Manager
    10. Downloading Files
    11. Read the Friendly Manual
    12. Useful Shortcuts
    13. Your Turn
    14. What You Learned
  4. 2. Creating an Ubuntu Virtual Machine with VirtualBoxCreating an Ubuntu Virtual Machine with VirtualBox
    1. Creating a New Virtual Machine
    2. Configuring a Network
    3. Installing the Guest Operating System
    4. Working with Snapshots
    5. Installing Software with the Package Manager
    6. Improving Performance by Installing Guest Additions
    7. Your Turn
    8. What You Learned
  5. 3. Navigating the Filesystem
    1. Listing Files and Directories
    2. Navigating Files and Folders
    3. Switching Between Directories
    4. Finding Files
    5. Identifying Available Disk Space
    6. Your Turn
    7. What You Learned
  6. 4. Working with Files and Directories
    1. Creating Files
    2. Reading Larger Files
    3. Creating Directories
    4. Copying, Moving, and Deleting Files and Directories
    5. Managing File and Directory Permissions
    6. Working with Links
    7. Getting More Information About Filesystem Objects
    8. Your Turn
    9. What You Learned
  7. 5. Streams of Text
    1. Redirecting Input and Output with File Descriptors
    2. Splitting Streams with tee
    3. Handling Standard Error Streams
    4. Filtering with grep
    5. Removing Characters from Output with cut
    6. Sorting Output
    7. Editing Streams with sed
    8. Advanced Processing with awk
    9. Using xargs
    10. Your Turn
    11. What You Learned
  8. 6. The Shell and Environment
    1. Exploring Environment and Shell Variables
    2. Editing Text with GNU nano
    3. Customizing Your Shell Session
    4. Creating Shortcuts with Aliases and Functions
    5. Creating Keyboard Shortcuts
    6. Modifying Readline Behavior
    7. Your Turn
    8. What You Learned
  9. 7. Running and Managing Programs
    1. Working with Commands
    2. Reusing Previous Commands and Arguments
    3. Managing Processes and Jobs
    4. Terminating Processes
    5. Using Command Substitution
    6. Keeping Commands Running with GNU Screen
    7. Your Turn
    8. What You Learned
  10. 8. Networking Tools
    1. Getting Your Connection Information
    2. Finding Information About Domain Names
    3. Testing Network Connectivity
    4. Making Web Requests with cURL
    5. Working with Web APIs
    6. Using Secure Shell to Connect to Remote Machines
    7. Transferring Files
    8. Exploring Network Connections
    9. Using Netcat
    10. Your Turn
    11. What You Learned
  11. 9. Automation
    1. Automating Tasks with make
    2. Writing Bash Scripts
    3. Automating Your Workstation Setup
    4. Your Turn
    5. What You Learned
  12. 10. Additional Programs
    1. Working with Text and Files
    2. Managing Your Environment
    3. Working with Data and External APIs
    4. Wrapping Up
  13. A1. Command Quick Reference
  14. A2. Installing GNU Utilities on macOS
    1. Installing coreutils
    2. Installing diffutils and findutils

Product information

  • Title: Small, Sharp Software Tools
  • Author(s): Brian P. Hogan
  • Release date: June 2019
  • Publisher(s): Pragmatic Bookshelf
  • ISBN: 9781680502961