Pipes & Redirects
Last updated
Was this helpful?
Last updated
Was this helpful?
cat /var/log/syslog | less | - pipe. less - display contents of a file or command output, one page at a time.
space - go to next page
b - go back
q - quit from less
interactive mode.
history | grep "sudo chmod"
grep - Global search for Regular Expressions and Print out
In the example we are looking for all commands with sudo chmod
.
history | grep sudo > sudo-commands.txt > - redirection operator.
>> - appends text to the EOF (end of file). Take the output from the previous command and send to a file.
We pipe or redirect the standard output from one command to the standard input of another command.