tail myfile.txt
Outputs the last 10 lines of the file myfile.txt.
tail myfile.txt -n 100
Outputs the last 100 lines of the file myfile.txt.
tail -f myfile.txt
Outputs the last 10 lines of myfile.txt, and monitors myfile.txt for updates; tail then continues to output any new lines that are added to myfile.txt.
tail -f access.log | grep 24.10.160.10
This is a useful example of using tail and grep to selectively monitor a log file in real time.
參考一
沒有留言:
張貼留言