Pipe Command:
| = Pipe command = Pipes the output of the previous command as an input to the next commandLess Command:
less [filename] = Displays the contents of a file or a command output, one page at a time. And allows to navigate forward and backward through the fileDifferent piping examples/use cases:
cat /var/log/syslog | less = Pipes the output of 'syslog' file to less program.ls /usr/bin | less = Pipes the output of ls command to less program.history | less = Pipes the output of history command to less program.Pipe & Grep:
Grep Command:
grep [pattern] = Searches for a particular pattern of characters and displays all lines that contain that patternMore piping examples/use cases:
history | grep sudo = Look for any commands of history commands, which have 'sudo' word in ithistory | grep "sudo chmod" = Look for any commands of history commands, which have 'sudo chmod' phrase in ithistory | grep sudo | less = History output will pass output to grep and filter for 'sudo' and this output will again be piped or passed to less programls /usr/bin/ | grep java = Filter ls output for javacat Documents/java-app/config.yaml | grep ports = See all 'ports' occurences in config.yaml fileRedirects in Linux:
> = Redirect Operator = Takes the output from the previous command and sends it to a file that you giveDifferent redirects examples/use cases: