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
Command Line Fundamentals

You're reading from   Command Line Fundamentals Learn to use the Unix command-line tools and Bash shell scripting

Arrow left icon
Product type Paperback
Published in Dec 2018
Publisher
ISBN-13 9781789807769
Length 314 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Vivek Nagarajan Vivek Nagarajan
Author Profile Icon Vivek Nagarajan
Vivek Nagarajan
Arrow right icon
View More author details
Toc

Tips and Tricks

Before we move on to the next case study, we will cover some material that is helpful, but was not covered in previous chapters. They fall into various categories and make some operations much easier. We will briefly describe some of them. Some of the information here will also be needed to solve the problems in Activity 10 in this chapter.

Suppressing Command Output

UNIX-like OSes provide a special file, called /dev/null, that can be used as a "black hole" for any data. Any writes to that file silently succeed and the data is discarded. This is useful when you need to suppress the output of commands. For instance, look at the following command:

ls >/dev/null

This runs ls and silently discards its output. Redirecting to /dev/null is usually helpful when suppressing error messages from commands that are run in a script.

Arithmetic Expansion

So far, we have used the $(( EXPR )) syntax for arithmetic expressions. However, there are some variations...

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 £16.99/month. Cancel anytime