Streaming into a file- linux command explanation needed
My question is simple, I am Linux-illiterate and don't know which terminology is appropriate for me to search online, I learn in school and on the Internet that I can perform a Linux's ls command as
开发者_开发技巧ls > text.txt
to write all of what ls will display into text.txt. And I would like to know how such commands are doing the standard IO ? Thank you
For any command that you run on the command line, you can append a '>', followed by a filename. This instructs the OS (specifically, the shell) to redirect output from the program into the given file. This is what you are doing in the example.
For more information, have a look at e.g.:
- http://en.wikipedia.org/wiki/Redirection_%28computing%29
- http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html (specifically the chapter "All about redirection").
精彩评论