From the course: Unix Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Suppressing output

Suppressing output - Unix Tutorial

From the course: Unix Essential Training

Start my 1-month free trial

Suppressing output

- [Instructor] We know how to send output to the screen and how to send it to a file. But what if we don't want any output at all? In this movie, we're going to learn how to suppress output completely. To do that, we need to know about something in Unix called /dev/null. /dev/null is often called the "null device" or the "bit bucket" or the "black hole". And it works a lot like a file. We can direct output to it. And any data that goes there will be discarded by Unix. So it's like sending data to a black hole. It just disappears. Once you know it's there, using it is very easy. For example, let's do ls -L, and of course, we get a listing of our current files. But if we instead take that and send the output to /dev/null, then we get no output. It didn't send it to our screen, it didn't send it to a file. It just went nowhere. All output was immediately flushed by the system. Let's try another example. Let's cat the…

Contents