There are multiple ways to view a log file using the Mac Terminal. Let's take a look at a few of them.
Option 1: Using cat
command
cat /var/log/system.log
Sep 5 00:29:28 C2cs-MacBook-Air syslogd[121]: ASL Sender Statistics
...
...
This will display the content of the entire log file at once and if the file is huge, it is less convenient.
Option 2: Using less
command
less /var/log/system.log
Sep 5 00:29:28 C2cs-MacBook-Air syslogd[121]: ASL Sender Statistics
...
...
You will see the contents of the file, one page at a time, and press the spacebar to view more.
Option 3: Using the tail
command
tail -30 20230901_server.logs
If you are interested in what was added to the log file recently, then it is better to make use of the tail command with the number of lines that you want to display on the console.
Best Option: Follow the logs in real-time
Most of the time the use-case is to observe the logs in real-time to see what is happening on the server's end, in such case you can follow the logs using the tail command with a -f flag.
tail -f -30 20230901_server.logs

-
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to MacOS,
- Clear Screen shortcut macOS Terminal
- What is macOS Ventura?
- [fix] How to Show file extensions on all files on Mac
- How to Find Where Mac Terminal App is Located?
- AutoSave button not working on Office on Mac (Word, Excel or Powerpoint)
- macOS say command text to speech using various voices and languages
- How to change Ping TTL value on macOS
- Open .bash_profile File in TextEdit using Terminal
- How to know the Safari Version on Mac
- How to Copy full Absolute Path of a File on Mac
- 13.0 MacOS Ventura release date
- Enable spell check in Sublime Text (macOS)
- How to Display Analog Clock on Mac Menu Bar
- How to turn off Location Services macOS Ventura 13
- How to Open VS Code on Mac
- Add Bookmark macOS Safari
- How to Fix cd: too many arguments Error in Terminal: A Step-by-Step Guide
- How to install wget on macOS
- Select Line Number TextEdit on Mac
- Strikethrough Text in Excel for Mac
- How to Enable or Disable Dark Mode on macOS Ventura 13
- How to hide or display Wifi icon in macOS Bug Sur Menu Bar
- How to install Yarn on Mac (macOS)
- How to fix command not found brew (bash, zsh) on macOS Terminal
- How to Schedule Mails in macOS Ventura
More Posts:
- Bash command to Read, Output and Manipulate JSON File - Bash
- Generate Project Dependency tree using Gradle Command - Gradle
- Bash Hello World! Script Tutorial - Bash
- GitPython: How to check out a Branch - Python
- Bash Command To Check If File Exists - Bash
- How to Vertically Center Align Text in a Div using CSS Code Example - CSS
- How to Split a String using delimiter in Python - Python
- Check macOS free disk space using Terminal command - MacOS