June 2019
Intermediate to advanced
328 pages
7h 27m
English
When you execute the history command, the program’s output is displayed on the screen. The history command writes its output to standard output, and standard output is mapped to your terminal screen by default.
You’ve already used the > and >> symbols to redirect a program’s output to a file. For example, you can save the contents of your shell history to a file:
| | $ history > commands.txt |
You also know that the >> symbol appends text to an existing file. For example, you can append today’s date to the file you just created:
| | $ date >> commands.txt |
Here’s how this concept works. The > and >> symbols redirect content to file descriptors, an abstract way for the OS to ...