How to properly look at it in the server log?

Everyone there is "prejudiced" The idea is to first listen to the words or get the first impression will dominate in the brain.

 

We usually use the tail command to view the log, in general we have a log file will be named to date. If you want to see past the log, should be how to see it?

 

Because I use vim command preconceived view the log, until one day, this is the only sense of Sao operation! ! ! That day, I was by looking at server logs vim, the result was unexpected top off (for some reason, view the server log requires remote connections), Well, I change an account to see the results suggest me, you can not edit editing document! ! !

 That I can not put up a bit, Baidu, try another command, really a lot.

 

1.cat

cat file name to view file

cat -n file name: line number to view the file

cat -b file name: line number to view the file, but does not display blank lines

 

2.head (front)

head - rows filename: View the first n rows of data

 

3.tail (after)

tail - Rows file name: n-line data review

 

4.more (see page file)

more filename

ctrl + f page forward

page backward ctrl + b

 

Summary: Since it is to view the file, it is wrong file for editing, they still do not view the log file (Sao operation) with vim, for the log file, try to use more page view, configuration files or scripts using cat to see, for being added to the log View file using the tail.

 

Guess you like

Origin www.cnblogs.com/ixan/p/11298617.html