1. Pipeline Flow
In Linux | Symbol represents pipeline Flow
Usage: Command1 | Command2
The standard output of the first command will be the standard input for the second command
Example: Cat A.txt | grep "ABC"
2.IO Stream
stdin---Standard input stream with descriptor 0
STDOUT---Standard output stream, descriptor 1
STDERR---Standard error stream, descriptor 2
3. Redirection
Output:
N> Redirect-overlay
Example: Cat A.txt 1>stdout.txt
REDIRECT the output from Cat a.txt to Stdout.txt, not in the terminal display
If stdout.txt exists, then overwrite, not present, create
N>> Redirect--add
Example: Cat A.txt 1>>stdout.txt
REDIRECT the output from Cat a.txt to Stdout.txt, not in the terminal display
If Stdout.txt exists, it is added at the end of the file, does not exist, creates
Description: 1.N represents the descriptor for IO stream in 3, and if n is omitted, the default is the standard output stream
Input:
<
Example:./a.out <a.txt
Set the input of the A.out program to think of A.txt
Reference: http://www.ibm.com/developerworks/cn/linux/l-lpic1-v3-103-4/
LINUX-----Pipeline Flow and redirection