Monday, October 16, 2017

Linux Search Logs File Command


tail -f /var/log/messages [will display 10lines of a file]
tail -50 -f /var/log/messages [will display more than 10 lines]
less /var/log/messages [to search entire log]
less /keyword [to search specific keyword in log file]

grep 'word' filename
grep 'word' file1 file2 file3
grep 'string1 string2'  filename
grep passwordname /etc/passwd

Tags:
#linux, #search, #grep, #less, #tail, #grep

Reference: Click here

No comments:

Post a Comment