background preloader

Linux: What are some time-saving tips that every Unix user should know? - Quora - StumbleUpon - Nightly (Build 20110507043313)

Linux: What are some time-saving tips that every Unix user should know? - Quora - StumbleUpon - Nightly (Build 20110507043313)

Learning the shell - Lesson 6: I/O Redirection In this lesson, we will explore a powerful feature used by many command line programs called input/output redirection. As we have seen, many commands such as ls print their output on the display. This does not have to be the case, however. By using some special notation we can redirect the output of many commands to files, devices, and even to the input of other commands. Standard Output Most command line programs that display their results do so by sending their results to a facility called standard output. [me@linuxbox me]$ ls > file_list.txt In this example, the ls command is executed and the results are written in a file named file_list.txt. Each time the command above is repeated, file_list.txt is overwritten (from the beginning) with the output of the command ls. [me@linuxbox me]$ ls >> file_list.txt When the results are appended, the new results are added to the end of the file, thus making the file longer each time the command is repeated. Standard Input Pipes Filters

Related: