From the course: Linux: Bash Shell and Scripts

Unlock the full course today

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

Using file descriptors, file redirection, pipes, and here documents

Using file descriptors, file redirection, pipes, and here documents - Linux Tutorial

From the course: Linux: Bash Shell and Scripts

Start my 1-month free trial

Using file descriptors, file redirection, pipes, and here documents

- [Narrator] Redirection for files, input and output, and using pipes really demonstrate the power of many of the features of what you use in bash. Firstly you want to keep in mind that processes normally have three files open. Files zero, one, and two. Zero we call standard in, one we call standard out, and two we call standard error. So notice there's two places output can go. Standard output and standard error. And with redirection our pipes we can separate out those or combine those if we want. When we run a command and on the command line we use a greater than all by itself, we're telling the shell to redirect the standard output of that command into the specified file. If on the command we put a two greater than, and it's important there's no space allowed between the two and the greater than. The two greater than means we're redirecting file number two, which is standard error. So error messages would get redirected to the specified file. And if we use a less than, that means…

Contents