Robin的主页

“Everything is a file” describes one of the defining features of Unix.

grep

grep 'word' filename
grep 'word' file1 file2 file3
grep 'string1 string2'  filename
cat otherfile | grep 'something'
command | grep 'something'
command option1 | grep 'data'
grep --color 'data' fileName

more about grep in How To Use grep Command In Linux / UNIX

How to View Logs Files?

less /var/log/messages
more -f /var/log/messages
cat /var/log/messages
tail -f /var/log/messages
grep -i error /var/log/messages

quoted from Linux Log Files Location And How Do I View Logs Files on Linux?

Piping Work in Linux

program1 arg arg | program2 arg arg

The vertical bar | is commonly referred to as a “pipe”. It is used to pipe one command into another. That is, it directs the output from the first command into the input for the second command. So your explanation is quite accurate.

more about | in

- - - - - -
written by 陈烨彬 Robin Chen , and published under (CC) BY-NC-SA.