Learn how to prevent output from a command by directing standard output to a null resource.
- [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 lorem_ipsum file. … And let's put that in /dev/null. …
Skill Level Intermediate
1. Introduction to Unix
2. Files and Directories
3. Ownership and Permissions
4. Commands and Processes
5. Directing Input and Output
6. Configure Your Working Environment
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.