The Hacker Ways
Minimum price
Suggested price

The Hacker Ways

A gentle introduction to the command line and the UNIX toolset.

About the Book

There is a better way to deal with computers. Hackers have been developing and using it for at least 40 years: it is the way of the command line, of the conversation with the computer in languages that are neither human nor machine, but a carefully crafted middle ground. Hackers, by the way, is how we call people who know well their tools, who dare to explore, and who need to build things.

If you want to use the computer to solve problems and you are not comfortable in a UNIX command line environment you will benefit from this book: it will take you to a level of understanding from which you'll be able to move forward, a first but solid stepping stone in the way to profficiency with the tools of the hackers.  Having a firm grasp of the tools and the ways of working on the command line will make you more efficient, more productive, and able to tackle more challenging problems.  

The Hacker Ways will teach you all you need to know to get started.  You'll learn how the command line works, and you'll understand its logic; you'll learn to edit files in Vi and Emacs, the two classic text editors; you'll learn about programming, you'll write your first programs.  You'll learn tools to do math and data analysis.  And you'll start playing with it all, which is the key to real learning. 

I wrote most of the contents of this book in order to introduce a smart and motivated audience (my two sons) to the world of the command line, the classic editors, and the basics of programming.  It has already achived its first objective.  I would be very glad if it could help you as well. 

About the Author
Juan Reyero

Juan Reyero has been working as a research and development engineer at Hewlett-Packard for the last 18 years.  First HP-UX, then Linux, and now OS-X: he has always used the UNIX tools for his research, he's built key development tools with them, and he's been teaching and proselitizing them in the HP R&D community and beyond.

Table of Contents

  • §1 — Introduction
    • Why this book
    • The UNIX tools and environment
    • The development process
    • The Way of the Future
  • §2 — The way of the terminal
    • A note on following this book
    • The directory structure
    • Listing the contents of a directory
    • Asking for help
    • Creating a directory
    • Everything is text
    • A conversation with the computer
    • Building and manipulating files
    • Copying and moving
    • Deleting
    • Multiple names for files
    • Wildcards
    • Completion
    • Command line history
    • Clean up
  • §3 — Basic UNIX tools
    • Bring in some content
    • Bundling files with tar
    • Finding files with find
    • Looking for differences between files
    • Find text in files
    • Finding words in files of a particular type
    • Looking for help
  • §4 — The way of the editor
    • Editing with Vi
    • Editing with Emacs
    • Programs are text files —and documents can be as well
    • Why bother
  • §5 — From the shell to a program
    • Our first program
    • Running the program
    • Program permissions
    • Variables in the shell
    • Sourcing scripts
    • Environment variables
    • Initializing environment variables
    • Conditionals in the shell
    • Looping the shell
    • Programming and the shell
  • §6 — Speaking Python
    • Running Python
    • Functions in Python
    • Variables in Python
    • Defining your own functions
    • Exit Python: the end of file, C-d
    • Writing a Python program
    • Command line arguments for your Python program
    • The shebang
    • Programming Python
    • Compiled languages and interpreted languages
  • §7 — Making the computer work for you
    • The case for improving your work environment
    • Running things in parallel with screen
    • A remote server running screen
    • Python packages
    • Installing Python packages with pip
    • Improve your Python environment with IPython
    • Asking for help in Python
    • Playing with Python and math
    • Solve equations and plot graphs

The Leanpub 60-day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

80% Royalties. Earn $16 on a $20 book.

We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $12 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub