Viewers: in countries Watching now:
Unix for Mac OS X Users unlocks the powerful capabilities of Unix that underlie Mac OS X, teaching how to use command-line syntax to perform common tasks such as file management, data entry, and text manipulation. The course teaches Unix from the ground up, starting with the basics of the command line and graduating to powerful, advanced tools like grep, sed, and xargs. The course shows how to enter commands in Terminal to create, move, copy, and delete files and folders; change file ownership and permissions; view and stop command and application processes; find and edit data within files; and use command-line shortcuts to speed up workflow. Exercise files accompany the course.
Now that we've talked about the basics of redirecting input and output, there is one last redirection technique that you should know about. Instead of redirecting output to a file or into a command, what if we want to have no output at all? This is especially useful when you become advanced enough that you're able to setup scripts on a server that run automatically at 4 a.m. even when there's not anyone logged in to view the output. At that point you don't need the output, right. You just want it to just do this thing and the output should just go away, and there may also be occasions where you want to run a program or you just don't want to see the output. You just want the program to do its thing and get its results.
Well we could just put the output to a file and then throw away the file, but there is an even easier way to do it. We can redirect the output to a special file that referred to as the null device. It's also sometimes called the bit bucket or the black hole, and it lives at /dev/null. Do you remember I told you that there were the special files for input and output that were represented at dev /standard in and dev/standard out? Well, dev/null is another one that's in that same folder. It's a special device where anything that's directed there Unix just discards.
It just like a black hole. We just send data there and Unix says "Oh, yeah okay, never mind." It's gone. It's not kept in memory. It's not kept in the file. It just disappears. And the way you send things to dev/null is the same way that you send them to any file. So for example let's just take a simple listing right, ls -la. Let's send that to dev/null, always at the root, all right,. Always we have to make sure we specify that so it knows the absolute path dev/null. We get no output. cat lorem_ipsum, let's send that to dev/ null. All right, there is nothing there.
If we want to bring in nothing, let's bring in nothing from dev/null, all right. It echoes back nothing to us. So it works just like a file. It's just like a special file, but it has this unique property of always staying empty. Now in truth you may not have need for this very often but it is an important concept I think for you to know, and so I want you to recognize it whenever you come across it in your future Unix endeavors, so that you know how you can have something that has absolutely no output. The way you suppress output is you direct the output to dev/null.
Find answers to the most frequently asked questions about Unix for Mac OS X Users .
Here are the FAQs that matched your search "" :
Sorry, there are no matches for your search "" —to search again, type in another word or phrase and click search.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.