Linux CLI Text Processing
Linux CLI Text Processing
About the Bundle
This bundle includes the following 7 ebooks:
- CLI text processing with GNU grep and ripgrep, GNU sed, GNU awk, Ruby One-Liners and Perl One-Liners will help you learn how to use these command line tools from the terminal. The various regex flavors used in grep/sed/awk are discussed in dedicated chapters/sections with plenty of examples. See my blog post for subtle differences between the BRE/ERE implementations in these tools.
- CLI text processing with GNU Coreutils teaches you more than twenty specialized text processing tools such as
head
,tail
,tr
,sort
,join
,cut
,paste
, etc. - Linux Command Line Computing aims to teach Linux command line tools and Shell Scripting for beginner to intermediate level users. The main focus is towards managing your files and performing text processing tasks.
Testimonials
I love your books on regex...As a student from the Digital VLSI space, it is indeed useful now and definitely in the future. It's really well written and really easy to understand the examples — feedback on reddit
Step up your cli fu with this fabulous intro & deep dive into awk. I learned a ton of tricks! — feedback on twitter
This Ruby one-liners cookbook is incredible. Pretty mind boggling all the stuff you can do. — feedback on twitter
In my opinion the book does a great job of quickly presenting examples of how commands can be used and then paired up to achieve new or interesting ways of manipulating data. Throughout the text there are little highlights offering tips on extra functionality or limitations of certain commands. For instance, when discussing the shuf command we're warned that shuf will not work with multiple files. However, we can merge multiple files together (using the cat command) and then pass them to shuf. These little gems of wisdom add a dimension to the book and will likely save the reader some time wondering why their scripts are not working as expected. — book review by Jesse Smith on distrowatch.com for "Command line text processing with GNU Coreutils"
I consider myself pretty experienced at shell-fu and capable of doing most things I set out to achieve in either bash scripts or fearless one-liners. However, my awk is rudimentary at best, I think mostly because it's such an unforgiving environment to experiment in. These books you've written are great for a bit of first principles insight and then quickly building up to functional usage. I will have no hesitation in referring colleagues to them! — feedback on Hacker News
Ive only gotten through first pages but appears a good Unix/bash primer. I’ll probably recommend for new hires out of bootcamp because they’re usually weak here — feedback on twitter for "Computing from the Command Line"
Thank you for choosing to write and share your knowledge. I read your books on CLI and sed - I think they are very comprehensive and very well explained. Keep up the great work — feedback on twitter
This is fantastic! 👏 I use Perl one-liners for record and text processing a lot and this will be definitely something I will keep coming back to - I’ve already learned a trick from “Context Matching” (9) 🙂 — feedback on Linux@lemmy.ml
Nice book! I just started trying to get into linux today and you have some tips I haven’t found elsewhere and the text is an enjoyable read so far — feedback on reddit
I discovered your books recently and they’re awesome, thank you! As a 20 year *nix they made me realize how much more there are to these rock solid and ancient tools, once you spend the time to actually learn the intricacies of them — feedback on reddit
I love the whole learn by example premise. Those exercises at the end are so valuable, as it often times leads me to find multiple solutions which helps me conceptualize how commands work with each other much better! — feedback on reddit
Bundle cover image created using canva.
About the Books
Linux Command Line Computing
Linux command line tools and Shell Scripting for beginner to intermediate level users
This ebook aims to teach Linux command line tools and Shell Scripting for beginner to intermediate level users. The main focus is towards managing your files and performing text processing tasks. Plenty of examples are provided to make it easier to understand a particular tool and its various features. Exercises at the end of chapters will help you practice what you've learned and solutions are provided for reference. External links are provided for further reading.
The features covered in this ebook are shaped and limited by my own experiences since 2007. I had a rough beginning as a design engineer having to learn Linux command line, Vim and Perl on the job. The biggest pain points were not knowing about handy options (for example, grep --color
to highlight matching portions, find -exec
to apply commands on filtered files, etc) and tools (for example, xargs
to workaround limitations of too many command line arguments). And then there were tools like sed
and awk
with intimidating syntax.
I hope this ebook would make it much easier for you to discover CLI tools, features and learning resources than my own blundering experience.
Prerequisites
You should be familiar with basic computer usage, know fundamental terms like files and directories, how to install programs and so on. You should also be already comfortable with programming basics like variables, loops and functions.
In terms of software, you should have access to the GNU bash
shell and commonly used Linux command line tools. This could be as part of a Linux distribution or via other means such as a Virtual Machine, WSL (Windows Subsystem for Linux) and so on.
You are also expected to get comfortable with reading manuals, searching online, visiting external links provided for further reading, tinkering with illustrated examples, asking for help when you are stuck and so on. In other words, be proactive and curious instead of just consuming the content passively.
Testimonials
Ive only gotten through first pages but appears a good Unix/bash primer. I’ll probably recommend for new hires out of bootcamp because they’re usually weak here — feedback on twitter
Nice book! I just started trying to get into linux today and you have some tips I haven’t found elsewhere and the text is an enjoyable read so far — feedback on reddit
GitHub repo
Visit https://github.com/learnbyexample/cli-computing for markdown source, example files, exercise solutions and other details related to the book.
Interactive exercises
I made an interactive TUI app for some of the text processing exercises from this book.
Chapters
- Preface
- Introduction and Setup
- Command Line Overview
- Managing Files and Directories
- Shell Features
- Viewing Part or Whole File Contents
- Searching Files and Filenames
- File Properties
- Managing Processes
- Multipurpose Text Processing Tools
- Sorting Stuff
- Comparing Files
- Assorted Text Processing Tools
- Shell Scripting
- Shell Customization
Feedback and Errata
I would highly appreciate it if you'd let me know how you felt about this ebook. It could be anything from a simple thank you, pointing out a typo, mistakes in code snippets, which aspects of the book worked for you (or didn't!) and so on. Reader feedback is essential and especially so for self-published authors.You can reach me via:
- Issue Manager: https://github.com/learnbyexample/cli-computing/issues
- E-mail: learnbyexample.net@gmail.com
- Twitter: https://twitter.com/learn_byexample
CLI text processing with GNU grep and ripgrep
The search is on
You are likely to be familiar with using a search dialog (usually invoked with the Ctrl+F
shortcut) to locate the occurrences of a particular string. The grep
command is a versatile and feature-rich version of that search functionality usable from the command line. An important feature that GUI applications may lack is regular expressions, a mini-programming language to precisely define a matching criteria.
This book heavily leans on examples to present features one by one. In addition to command options, regular expressions will also be discussed in detail. Two different implementations are discussed in this book — GNU grep and ripgrep.
Exercises are also included to test your understanding.
Prerequisites
You should be familiar with command line usage in a Unix-like environment. You should also be comfortable with concepts like file redirection and command pipelines.
You are also expected to get comfortable with reading manuals, searching online, visiting external links provided for further reading, tinkering with illustrated examples, asking for help when you are stuck and so on. In other words, be proactive and curious instead of just consuming the content passively.
If you are new to the world of the command line, check out my Computing from the Command Line ebook and curated resources on Linux CLI and Shell scripting before starting this book.
GitHub repo
Visit https://github.com/learnbyexample/learn_gnugrep_ripgrep for markdown source, example files, exercise solutions and other details related to the book.
Interactive exercises
Based on the book contents as well as the exercises, I made an interactive TUI app with 50+ questions. Reference solutions are provided for both GNU grep
and ripgrep
.
Feedback and Errata
I would highly appreciate it if you'd let me know how you felt about this ebook. It could be anything from a simple thank you, pointing out a typo, mistakes in code snippets, which aspects of the book worked for you (or didn't!) and so on. Reader feedback is essential and especially so for self-published authors.
You can reach me via:
- Issue Manager: https://github.com/learnbyexample/learn_gnugrep_ripgrep/issues
- E-mail: learnbyexample.net@gmail.com
- Twitter: https://twitter.com/learn_byexample
CLI text processing with GNU sed
awesome stream editor
You are likely to be familiar with using a search and replace dialog (usually invoked with the Ctrl+H
shortcut) to locate the occurrences of a particular string and replace it with something else. The sed
command is a versatile and feature-rich version for search and replace operations, usable from the command line. An important feature that GUI applications may lack is regular expressions, a mini-programming language to precisely define a matching criteria.
This book heavily leans on examples to present features one by one. In addition to command options, regular expressions will also be discussed in detail.
Exercises are also included to test your understanding.
Prerequisites
You should be familiar with command line usage in a Unix-like environment. You should also be comfortable with concepts like file redirection and command pipelines. Knowing the basics of the grep
command will be handy in understanding the filtering features of sed
.
You are also expected to get comfortable with reading manuals, searching online, visiting external links provided for further reading, tinkering with illustrated examples, asking for help when you are stuck and so on. In other words, be proactive and curious instead of just consuming the content passively.
If you are new to the world of the command line, check out my Computing from the Command Line ebook and curated resources on Linux CLI and Shell scripting before starting this book.
Testimonials
Thank you for choosing to write and share your knowledge. I read your books on CLI and sed - I think they are very comprehensive and very well explained. Keep up the great work — feedback on twitter
GitHub repo
Visit https://github.com/learnbyexample/learn_gnused for markdown source, example files, exercise solutions and other details related to the book.
Interactive exercises
Based on the book contents as well as the exercises, I made an interactive TUI app with 50+ questions. Reference solutions are also provided.
Feedback and Errata
I would highly appreciate it if you'd let me know how you felt about this ebook. It could be anything from a simple thank you, pointing out a typo, mistakes in code snippets, which aspects of the book worked for you (or didn't!) and so on. Reader feedback is essential and especially so for self-published authors.
You can reach me via:
- Issue Manager: https://github.com/learnbyexample/learn_gnused/issues
- E-mail: learnbyexample.net@gmail.com
- Twitter: https://twitter.com/learn_byexample
CLI text processing with GNU awk
field processing and other awesome one-liners
About
When it comes to command line text processing, the three major pillars are grep
for filtering, sed
for substitution and awk
for field processing. This book will dive deep into field processing, show examples for filtering features, multiple file processing, how to construct solutions that depend on multiple records, how to compare records and fields between two or more files, how to identify duplicates while maintaining input order and so on.
This book heavily leans on examples to present features one by one. Regular Expressions will also be discussed in detail.
Exercises are also included to test your understanding.
Prerequisites
You should be familiar with command line usage in a Unix-like environment. You should also be comfortable with concepts like file redirection and command pipelines. Knowing the basics of the grep
and sed
commands will be handy in understanding the filtering and substitution features of awk
.
As awk
is a programming language, you are also expected to be familiar with concepts like variables, printing, functions, control structures, arrays and so on.
You are also expected to get comfortable with reading manuals, searching online, visiting external links provided for further reading, tinkering with illustrated examples, asking for help when you are stuck and so on. In other words, be proactive and curious instead of just consuming the content passively.
If you are new to the world of the command line, check out my Computing from the Command Line ebook and curated resources on Linux CLI and Shell scripting before starting this book.
Testimonials
Step up your cli fu with this fabulous intro & deep dive into awk. I learned a ton of tricks! — feedback on twitter
I consider myself pretty experienced at shell-fu and capable of doing most things I set out to achieve in either bash scripts or fearless one-liners. However, my awk is rudimentary at best, I think mostly because it's such an unforgiving environment to experiment in. These books you've written are great for a bit of first principles insight and then quickly building up to functional usage. I will have no hesitation in referring colleagues to them! — feedback on Hacker News
GitHub repo
Visit https://github.com/learnbyexample/learn_gnuawk for markdown source, example files, exercise solutions and other details related to the book.
Interactive exercises
Based on the book contents as well as the exercises, I made an interactive TUI app with 80+ questions. Reference solutions are also provided.
Feedback and Errata
I would highly appreciate it if you'd let me know how you felt about this ebook. It could be anything from a simple thank you, pointing out a typo, mistakes in code snippets, which aspects of the book worked for you (or didn't!) and so on. Reader feedback is essential and especially so for self-published authors.
You can reach me via:
- Issue Manager: https://github.com/learnbyexample/learn_gnuawk/issues
- E-mail: learnbyexample.net@gmail.com
- Twitter: https://twitter.com/learn_byexample
CLI text processing with GNU Coreutils
Example based guide for specialized text processing commands
Any beginner learning Linux command line tools would come across the cat command within the first week. Sooner or later, they'll come to know popular text processing tools like grep, head, tail, tr, sort, etc. If you were like me, you'd come across sed and awk, shudder at their complexity and prefer to use a scripting language like Perl and text editors like Vim instead (don't worry, I've already corrected that mistake).
Knowing power tools like grep, sed and awk can help solve most of your text processing needs. So, why would you want to learn text processing tools from the coreutils package? The biggest motivation would be faster execution since these tools are optimized for the use cases they solve. And there's always the advantage of not having to write code (and test that solution) if there's an existing tool to solve the problem.
This book will teach you more than twenty of such specialized text processing tools provided by the GNU coreutils
package. Plenty of examples and exercises are provided to make it easier to understand a particular tool and its various features.
Prerequisites
You should be familiar with command line usage in a Unix-like environment. You should also be comfortable with concepts like file redirection and command pipelines.
You are also expected to get comfortable with reading manuals, searching online, visiting external links provided for further reading, tinkering with illustrated examples, asking for help when you are stuck and so on. In other words, be proactive and curious instead of just consuming the content passively.
Testimonials
In my opinion the book does a great job of quickly presenting examples of how commands can be used and then paired up to achieve new or interesting ways of manipulating data. Throughout the text there are little highlights offering tips on extra functionality or limitations of certain commands. For instance, when discussing the shuf command we're warned that shuf will not work with multiple files. However, we can merge multiple files together (using the cat command) and then pass them to shuf. These little gems of wisdom add a dimension to the book and will likely save the reader some time wondering why their scripts are not working as expected — book review by Jesse Smith on distrowatch.com
I discovered your books recently and they’re awesome, thank you! As a 20 year *nix they made me realize how much more there are to these rock solid and ancient tools, once you spend the time to actually learn the intricacies of them — feedback on reddit
GitHub repo
Visit https://github.com/learnbyexample/cli_text_processing_coreutils for markdown source, example files, exercise solutions and other details related to the book.
Chapters
- Preface
- Introduction
- cat and tac
- head and tail
- tr
- cut
- seq
- shuf
- paste
- pr
- fold and fmt
- sort
- uniq
- comm
- join
- nl
- wc
- split
- csplit
- expand and unexpand
- basename and dirname
- What next?
Feedback and Errata
I would highly appreciate it if you'd let me know how you felt about this ebook. It could be anything from a simple thank you, pointing out a typo, mistakes in code snippets, which aspects of the book worked for you (or didn't!) and so on. Reader feedback is essential and especially so for self-published authors.
You can reach me via:
Perl One-Liners Guide
Example based guide for text processing with Perl from the command line
About
When it comes to command line text processing, there are several well known tools like grep for filtering, sed for substitution and awk for field processing. Compared to such tools, Perl has a feature rich regular expression engine, plenty of builtin modules and a thriving ecosystem. Another advantage is that Perl is more portable.
Perl One-Liners Guide will show examples for filtering and substitution features, field processing, using standard and third-party modules, multiple file processing, how to construct solutions that depend on multiple records, how to compare records and fields between two or more files, how to identify duplicates while maintaining input order and so on.
This book heavily leans on examples to present features one by one. Exercises are also included to test your understanding.
Prerequisites
You should be comfortable with programming basics and have prior experience working with Perl. You should know concepts like scalar, array, hash, special variables and be familiar with control structures, regular expressions, etc.
You should be familiar with command line usage in a Unix-like environment. You should also be comfortable with concepts like file redirection and command pipelines. Knowing the basics of the grep
, sed
and awk
commands will come in handy as well.
You are also expected to get comfortable with reading manuals, searching online, visiting external links provided for further reading, tinkering with illustrated examples, asking for help when you are stuck and so on. In other words, be proactive and curious instead of just consuming the content passively.
Testimonials
This is fantastic! 👏 I use Perl one-liners for record and text processing a lot and this will be definitely something I will keep coming back to - I’ve already learned a trick from “Context Matching” (9) 🙂 — feedback on Linux@lemmy.ml
GitHub repo
Visit https://github.com/learnbyexample/learn_perl_oneliners for markdown source, example files, exercise solutions and other details related to the book.
Chapters
- Preface
- One-liner introduction
- Line processing
- In-place file editing
- Field separators
- Record separators
- Using modules
- Multiple file input
- Processing multiple records
- Two file processing
- Dealing with duplicates
- Perl rename command
Feedback and Errata
I would highly appreciate it if you'd let me know how you felt about this ebook. It could be anything from a simple thank you, pointing out a typo, mistakes in code snippets, which aspects of the book worked for you (or didn't!) and so on. Reader feedback is essential and especially so for self-published authors.
You can reach me via:
- Issue Manager: https://github.com/learnbyexample/learn_perl_oneliners/issues
- E-mail: learnbyexample.net@gmail.com
- Twitter: https://twitter.com/learn_byexample
Ruby One-Liners Guide
Example based guide for text processing with Ruby from the command line.
About
When it comes to command line text processing, there are several well known tools like grep for filtering, sed for substitution and awk for field processing. Compared to such tools, Ruby has a feature rich regular expression engine, plenty of builtin modules and a thriving ecosystem. Another advantage is that Ruby is more portable.
Ruby One-Liners Guide will show examples for filtering and substitution features, field processing, using standard and third-party modules, multiple file processing, how to construct solutions that depend on multiple records, how to compare records and fields between two or more files, how to identify duplicates while maintaining input order and so on.
This book heavily leans on examples to present features one by one. Exercises are also included to test your understanding.
Prerequisites
You should be comfortable with programming basics and have prior experience working with Ruby. You should know concepts like blocks, be familiar with string/array/hash/enumerable methods, regular expressions etc.
You should be familiar with command line usage in a Unix-like environment. You should also be comfortable with concepts like file redirection and command pipelines. Knowing the basics of the grep
, sed
and awk
commands will come in handy as well.
You are also expected to get comfortable with reading manuals, searching online, visiting external links provided for further reading, tinkering with illustrated examples, asking for help when you are stuck and so on. In other words, be proactive and curious instead of just consuming the content passively.
Testimonials
This Ruby one-liners cookbook is incredible. Pretty mind boggling all the stuff you can do.
— feedback on twitter
GitHub repo
Visit https://github.com/learnbyexample/learn_ruby_oneliners for markdown source, example files, exercise solutions and other details related to the book.
Feedback and Errata
I would highly appreciate it if you'd let me know how you felt about this ebook. It could be anything from a simple thank you, pointing out a typo, mistakes in code snippets, which aspects of the book worked for you (or didn't!) and so on. Reader feedback is essential and especially so for self-published authors.
You can reach me via:
- Issue Manager: https://github.com/learnbyexample/learn_ruby_oneliners/issues
- E-mail: learnbyexample.net@gmail.com
- Twitter: https://twitter.com/learn_byexample
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.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $13 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