Question: what is the difference between pipe and redirect?
Answer: What is the difference between “Redirection” and “Pipe”? ... Redirection is used to redirect the stdout/stdin/stderr, e.g. ls > log. txt . Pipes are used to give the output of a command as input to another command, e.g. ls | grep file.