Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Working with Linux ??? Quick Hacks for the Command Line

You're reading from   Working with Linux ??? Quick Hacks for the Command Line Command line power like you've never seen

Arrow left icon
Product type Paperback
Published in May 2017
Publisher Packt
ISBN-13 9781787129184
Length 222 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Authors (2):
Arrow left icon
Bogdan Vaida Bogdan Vaida
Author Profile Icon Bogdan Vaida
Bogdan Vaida
Petru I»ôfan Petru I»ôfan
Author Profile Icon Petru I»ôfan
Petru I»ôfan
Arrow right icon
View More author details
Toc

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
Pipes and subshells – your shell's salt and pepper

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...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime