Book Image

Working with Linux ??? Quick Hacks for the Command Line

By : Bogdan Vaida, Petru I»ôfan
Book Image

Working with Linux ??? Quick Hacks for the Command Line

By: Bogdan Vaida, Petru I»ôfan

Overview of this book

Websites, online services, databases, and pretty much every other computer that offers public services runs on Linux. From small servers to clusters, Linux is anywhere and everywhere. With such a broad usage, the demand for Linux specialists is ever growing. For the engineers out there, this means being able to develop, interconnect, and maintain Linux environments. This book will help you increase your terminal productivity by using Terminator, Guake and other tools. It will start by installing Ubuntu and will explore tools and techniques that will help you to achieve more work with less effort. Next, it will then focus on Terminator, the ultimate terminal, and vim, one of the most intelligent console editors. Futhermore, the readers will see how they can increase their command line productivity by using sed, find, tmux, network, autoenv. The readers will also see how they can edit files without leaving the terminal and use the screen space efficiently and copy-paste like a pro. Towards the end, we focus on network settings, Git hacks, and creating portable environments for development and production using Docker. Through this book, you will improve your terminal productivity by seeing how to use different tools.
Table of Contents (13 chapters)

Pipes and subshells – your shell's salt and pepper

In this section, we will be looking at ways to improve your productivity using your shell. The Linux command line is great because it has a variety of tools we can use. What makes it even greater is the fact that we can chain these tools together to form greater, more powerful tools that will make us even more productive. We will not go into basic shell commands; instead we will be looking at some cool pipe and subshell combinations that can make our lives easier.

Let's start with a basic pipe; in this example, we are counting the length of the current path using the following command:

pwd | wc -c

pwd, as you probably know, stands for print working directory. The | is the pipe symbol, and what it does is send the output of the command on the left to the command on the right. In our case, pwd is sending its output to wc -c, which counts the number of characters. The coolest thing about pipes is that you can create a chain of any number of...