How do I open a log file in Unix?

How do I open a log file in Unix?
Answer
Linux: How to view log files on the shell?
  1. Get the last N lines of a log file. The most important command is “tail”. …
  2. Get new lines from a file continuously. To get all newly added lines from a log file in realtime on the shell, use the command: tail -f /var/log/mail.log. …
  3. Get the result line by line. …
  4. Search in a log file. …
  5. View the whole content of a file.
 

Tìm kiếm

Back
Top