Home » Questions » Computers [ Ask a new question ]

Question on the <> Linux Redirection Operator

Question on the <> Linux Redirection Operator

I'm studying for my LPIC-1 and I'm confused by the <> redirection operator. I know the official definition for this is that it "causes the specified file to be used for both standard input and standard output"... but I'm still confused.

Asked by: Guest | Views: 300
Total answers/comments: 1
Guest [Entry]

"An example would be when you need to supply a program input data, and also send output data somewhere (eg. a file):

$ sort < data.txt > result.txt

this runs the data in data.txt through the sort command, and sends the output to result.txt. It is identical to doing this:

$ sort data.txt > result.txt

Think of it like this:

(2 <- 1) -> 3

The middle file is fed to the program at number 2, and the result is finally sent to 3."