Caxton
Features Benchmarks Pricing Docs How it works Changelog Support About Download Free
Guides
All guides Large File Text Editors EmEditor for Mac UltraEdit Alternatives Notepad++ Alternatives Notepad for Mac Free Text Editors for Mac File Too Large for VS Code CSV Editor for Mac Open a CSV File CSV Viewer for Mac Open a TSV or Pipe-Delimited File Edit CSV Without Auto-Formatting Repair a Malformed CSV Remove Duplicate Rows Validate a CSV Transform a CSV Column Fixed-Width to CSV Change a CSV Delimiter Split a Large CSV Combine CSV Files Sort a Large CSV CSV Too Big for Excel Open a Huge CSV Log Viewer for Mac View Log Files Follow a Live Log File CMTrace for Mac Open a 10 GB Log Filter Large Log Files Jump to a Time in a Log Find & Replace in Huge Files Find & Replace Across Files Regex Cheat Sheet Compare Two Text Files Open a SQL Dump Fix Garbled Text & Encoding Convert a File to UTF-8 Remove a BOM Convert Line Endings Remove Invisible Characters Smart Quotes to Straight Quotes Sort & Dedupe Lines Open a GBK or Big5 File Open a UTF-16 or Shift-JIS File Open a Large JSON File Numbers File Too Large

How to follow a live log file on a Mac.

A server is misbehaving, a build is running or an import is halfway through, and the next line of the log is the one you need. Reading the file once is not enough. You want to watch the log as it updates, with each new line on screen as the program writes it. That is called following the file, or tailing it. Every Mac has the tools for it already installed, and they part ways at one point: what happens when the log is rotated while you watch. This guide runs each of them on a log that is rotated mid-stream, shows how to filter what scrolls past, and covers following a large log in an editor window.

Download Caxton for Free · 7-day free trial of Caxton Pro, no credit card required · 8 MB · macOS 13.0+

The short answer

To follow a log file on a Mac, open Terminal and run tail -f followed by the file's name, which prints each new line as it is written until you press Control-C. Use tail -F when the log is rotated, and less +F when you also want to scroll back and search. Caxton, a native Mac editor for text and data files, follows a log of 300 MB or more: open the file, choose Tail in the Open Large File dialog, click Open, then click Follow in the toolbar.

How do I follow a log file with tail -f on a Mac?

Run tail -f with the file's name in Terminal. tail prints the end of a file, and Apple's manual page describes what the option adds: "The -f option causes tail to not stop when end of file is reached, but rather to wait for additional data to be appended to the input." The command is already installed on every Mac. The examples in this guide use a log named app.log in the current folder, so put the path to your own file in its place.

tail -f app.log

It first prints the last 10 lines, because the manual's default starting point is "the last 10 lines of the input," and then it prints each new line as the program writes it. In a test, three lines were appended to a 12-line file while the command ran, and the window ended like this:

2026-11-22 14:00:11 INFO  request 11 served
2026-11-22 14:00:12 INFO  request 12 served
2026-11-22 14:00:13 INFO  request 13 served
2026-11-22 14:00:14 WARN  request 14 slow: 2210 ms
2026-11-22 14:00:15 ERROR request 15 failed: upstream timed out

Press Control-C to stop. tail only prints. It has no commands of its own for scrolling back, searching or pausing, so the Terminal window is where you read what it has printed.

To choose how much of the file comes first, add -n with a number of lines:

tail -n 20 -f app.log
tail -n 0 -f app.log

The first starts with the last 20 lines. The second starts with none and shows only what is written from that moment on, which is the clean way to watch what one action does: start it, send the request or click the button, and read what appears.

What is the difference between tail -f and tail -F?

The capital F keeps working when the log is rotated, and the small f does not. Rotation is how a long-running program keeps its log from growing without end: the current file is renamed, for example from app.log to app.log.1, and a new, empty app.log is started in its place. tail -f holds on to the file it opened, which is now app.log.1, and prints nothing more. tail -F switches to the new file. Apple's manual page explains how: "The -F option implies the -f option, but tail will also check to see if the file being followed has been renamed or rotated. The file is closed and reopened when tail detects that the filename being read from has a new inode number."

Here is that difference in a test. A loop appended one numbered line to app.log every half second, opening the file by name each time. Both commands were following the file when it was rotated after line 10, with these two commands:

mv app.log app.log.1
touch app.log

The loop wrote on into the new app.log, up to line 21. tail -f app.log printed 10 lines and then stayed silent. Its last two lines were these:

2026-11-22 14:00:09 INFO  request 9 served
2026-11-22 14:00:10 ERROR request 10 failed: upstream timed out

tail -F app.log printed all 21, and went from the old file into the new one without a break:

2026-11-22 14:00:09 INFO  request 9 served
2026-11-22 14:00:10 ERROR request 10 failed: upstream timed out
2026-11-22 14:00:11 INFO  request 11 served
2026-11-22 14:00:12 INFO  request 12 served

Nothing is printed to mark the switch, so with -F a rotation passes unnoticed, which is usually what you want. The same manual page adds that -F waits for a file that is not there yet: "If the file being followed does not (yet) exist or if it is removed, tail will keep looking and will display the file from the beginning if and when it is created."

Two details complete the picture, and both were tested the same way. A program that has not yet been told to reopen its log keeps writing to the renamed file, and tail -f keeps printing those lines, so the small f is the right choice when the old file is the one you mean to watch. And a log that is emptied in place, which some rotation tools do in place of a rename, did not stop either command: both printed the lines written after the file was emptied.

For anything you leave running for more than a few minutes, make -F the habit.

How do I follow a log with less +F?

Use less +F when you want to follow a log and also read back through it. less is the pager that is already installed on a Mac, and its F command follows a file. The manual page describes F as "Scroll forward, and keep trying to read when the end of file is reached," and calls it "a way to monitor the tail of a file which is growing while it is being viewed." Starting with +F gives that command at launch, because, in the manual's words, "If a command line option begins with +, the remainder of that option is taken to be an initial command to less."

less +F app.log

The window fills with the end of the file, with this line at the bottom while less waits:

Waiting for data... (^X or interrupt to abort)

New lines appear above it as they are written. What sets less apart is the way out of follow mode. Press Control-C and less stops following but stays open on the whole file, as an ordinary pager. Press b to go back a screen, type a slash and a word and press Return to search, and press F to follow again from the end. Press q to quit. In the test, Control-C, b, a search and F were pressed in that order, and the two lines written afterwards appeared once follow mode was on again.

Like tail -f, less +F stays with the file it opened when the log is rotated. The manual is direct about it: "Normally, if the input file is renamed while an F command is executing, less will continue to display the contents of the original file despite its name change." The option that changes this is --follow-name, with which "less will periodically attempt to reopen the file by name."

less --follow-name +F app.log

In the rotation test, plain less +F showed none of the lines written to the new file. With --follow-name, less switched to the new app.log and showed its lines from the first one. The old file's lines were no longer in the window after the switch, so open app.log.1 to read them.

How do I filter a log while following it?

Pipe tail into grep, and only the lines that match are printed:

tail -f app.log | grep --line-buffered ERROR

Every new line is tested as it arrives, and the ones without the word are dropped. The --line-buffered option matters as soon as grep's output goes anywhere but the Terminal window. Apple's manual page for grep gives the rule: "By default, output is line buffered when standard output is a terminal and block buffered otherwise." Block buffered means grep collects its matches and releases them in batches, and on a quiet log a batch can take a long time to fill. In a test that sent the output to a file, four matching lines arrived while the command was still running with the option. Without it, none arrived until the command was stopped.

So type the option every time. The command then keeps working when you extend it, for example to keep a copy of what you saw:

tail -f app.log | grep --line-buffered ERROR | tee errors.txt

tee prints each line and writes it to errors.txt as well. To match more than one word, give grep -E and separate the words with a bar:

tail -f app.log | grep --line-buffered -E 'ERROR|WARN'

With the capital F the filter carries on through a rotation. In the rotation test, tail -F app.log | grep --line-buffered ERROR printed the error lines from the old file and from the new one.

This is a job the command line does better than an app with a window. The filter is live, it costs one line of typing, and it can feed a file or another command.

How do I watch the Mac's own log as it updates?

Use log stream. The messages that macOS logs, and the ones apps send through Apple's logging system, do not go to a file you can tail. They go to the unified log, and Apple's manual page describes the command that follows it: "Stream activities, log data or trace messages for the system or from a given process." Run with nothing else it streams messages from the whole system, so narrow it with a predicate. The --predicate option "Filters messages using the provided predicate based on NSPredicate or shorthand," and one of the keys a predicate can test is process, "The name of the process that originated the event."

log stream --predicate 'process == "logger"' --style compact

This example is easy to try, because logger is a command that writes one message to the system log. With the stream running, open a second Terminal window and run:

logger "hello from the follow guide"

The first window then holds the predicate, a header line and the message:

Filtering the log data using "process == "logger""
Timestamp               Ty Process[PID:TID]
2026-11-22 15:43:00.071 Df logger[96382:17f37ec] hello from the follow guide

Put the name of the app or service you are watching in place of logger, and press Control-C to stop. How to view log files on a Mac covers the Console app, the log show command for messages that are already in the log, and where log files are kept.

How do I follow a log file in Caxton?

Caxton follows a log in a window, with a toolbar button named Follow. The button belongs to one way of opening a file, called Tail, and Caxton offers Tail for a file of 300 MB or more. So these steps are for large logs, the kind a busy server writes all day. For a smaller log the commands above are the better tool, and the section after this one covers what Caxton does with one. Following is viewing, and every step below works on Caxton Free.

1. Open the log and choose Tail

Drag the file onto Caxton, or choose File ▸ Open… and pick it. A file of 300 MB or more brings up the Open Large File dialog, which lists four ways to open it under Open as. Click the Tail card. The card carries the line "Load only the last N megabytes. Best for live logs," and its field, between the words Last and MB, starts at 100. Type another number to load more or less of the file, 1 at the least, and click Open. The window shows the end of the file, and the status bar gains a pill that starts with the word Tail and gives the size of the loaded part.

2. Click Follow in the toolbar

A window opened as Tail has a Follow button in its toolbar. Click it. The button's label changes to Following, the view moves to the last line, and from then on Caxton checks the file for new bytes once a second and holds the view on the end as lines arrive. The status bar gains a Following pill as well. Follow starts at the byte where the loaded part ends, so lines written between opening the file and clicking the button are not skipped.

The toolbar button is the only control. Follow has no menu item and no keyboard shortcut, and Caxton places the button in the toolbar of every Tail window by itself. New lines move the view and nothing else: the caret stays where you left it, and the lines add nothing to the undo history.

3. Scroll up to pause, and back down to resume

To read something that has gone past, scroll up. Follow pauses as soon as the view leaves the end of the file, and the button's label returns to Follow. Scroll back to the bottom and Follow resumes without a click. Clicking the button also turns Follow off and on, and a Follow you turned off with the button stays off until you click it again.

While Follow is paused, Caxton does not read the file. When it resumes, it carries on from the byte where it stopped, so the lines written during the pause arrive then. To read further back than the part you loaded, scroll to the top edge of the text, where a Load previous button brings in the block before it.

4. Watch the lag, and catch up when the log outruns the window

When the file grows faster than Caxton takes it in, the button and the status bar pill change to Following · N behind, where N is the amount of the file that has not been read yet. Past half a gigabyte of backlog, Caxton stops working through it. It reloads the last 64 MB of the file, follows on from there, and shows a banner with the size of the part it skipped and that part's first and last byte.

View ▸ Log ▸ Catch Up to Live does the same on demand, and it is available while Follow is on. The skipped part stays within reach: View ▸ Log ▸ Open Skipped Range as Slice opens exactly those bytes in a window of their own. Neither item has a keyboard shortcut.

There are two cases where Caxton does not catch up by itself. With unsaved edits in the window, it pauses Follow and leaves the edits alone, and the menu item asks before it discards them. On a file in an encoding other than UTF-8, it pauses Follow and shows a banner that points to the menu item.

5. Choose what happens when the log is rotated

Caxton asks you, each time. When the file at the path is replaced by a new one, Caxton first reads what is left of the old file, then stops following and opens a sheet titled Log file rotated. The sheet gives the file's name with the words "was replaced by a new file at the same path," and when part of the old file had not been read yet it gives the amount. It has two buttons:

  • Follow New File reloads the window from the new file and turns Follow back on.
  • Stay on Old keeps the text already in the window and leaves Follow off. It is the default button, so pressing Return chooses it.

There is no setting that answers the question in advance. A log left following overnight will be waiting at the sheet after its first rotation, with the old file's last lines in the window, and the new file's lines are not read until you choose Follow New File. With unsaved edits in the window, the sheet includes one more line: following the new file discards them. For a follower that must keep going unattended, tail -F is the tool.

A log that is emptied in place, without a rename, gets no question. Caxton reloads the window from the file's new end, keeps following, and shows a banner that the file was truncated. With unsaved edits in the window it pauses Follow and shows a banner that asks you to save or discard them and then turn Follow on again. If the file is deleted or moved away and nothing takes its place, Follow stops and a banner appears, with the file's new path when it was moved.

6. Search, filter and bookmark while the log runs

The window is an editor view, so its tools work on a followed log. In a file Caxton recognizes as a log, error and warning lines carry a tinted band, and new lines are tinted as they are drawn. ⌘F finds text, ⇧⌘L opens Filter Lines with its Severity popup, ⌥⌘L opens Go to Time, and ⇧⌘B bookmarks the line the caret is on. Jumping to a match or a time moves the view away from the end, which pauses Follow the way a scroll does. Filter large log files on a Mac goes through the filter in detail.

One limit matters here. A filter covers the lines that were in the window when it ran, and it does not run again by itself as lines arrive. Once the file has grown, the filter bar's counter changes to Results may be outdated and a Refresh button appears beside it. Click Refresh to take the new lines into the filter. The Find results panel shows the same notice for a search. If what you want is one kind of message scrolling past as it happens, tail -f piped into grep does that and Caxton's filter does not.

Opening a log of any size, Tail, Follow, Catch Up to Live, Open Skipped Range as Slice, Find, Filter Lines, Go to Time and bookmarks are all Caxton Free. Changing the file is a different matter. Caxton Free edits and saves files of up to 10 MB, and a file opened as Tail is far larger than that, so editing or saving it needs Caxton Pro. Writing the filtered lines to a new file with Edit ▸ Find ▸ Save Filtered Lines… is Caxton Pro as well. Every download includes a 7-day free trial of Caxton Pro with no credit card required.

Can Caxton follow a log smaller than 300 MB?

Not line by line. A file under 300 MB opens whole, without the dialog, and its toolbar has no Follow button. Caxton still watches the file. When another program writes to it, Caxton reloads it and shows the banner "The file changed on disk, so Caxton reloaded it." With unsaved edits in the window it asks first, in a sheet with Keep Mine, Reload and Compare… buttons. That keeps the window current, but each change is a reload of the whole file. It is not a stream of new lines with the view held on the end. To follow a small log line by line, use tail -f or less +F.

Which way of following a log fits which job?

The jobTools already on a MacIn Caxton
Watch a small or medium log for a few minutes.tail -f is the quickest way, and it is already installed.A file under 300 MB opens whole and is reloaded when it changes. There is no Follow for it.
Leave a follower running across log rotations.tail -F moves to the new file without asking.Follow stops at each rotation and asks, with Follow New File and Stay on Old.
Follow, and also scroll back and search.less +F, with Control-C to page and search and F to follow again.In a Tail window, scroll up to pause and press ⌘F. Scrolling back to the end resumes Follow.
See only the errors as they arrive.tail -f piped into grep --line-buffered tests every new line.Filter Lines covers the lines already loaded, and Refresh takes in the new ones.
Follow a log of several gigabytes that grows fast.The same commands, unchanged.Tail loads only the end of the file, the Follow button shows how far behind it is, and Catch Up to Live skips ahead and keeps the skipped bytes within reach.
Keep the matching lines in a file.Add tee to the pipeline.Edit ▸ Find ▸ Save Filtered Lines… writes them to a new file, on Caxton Pro.
Watch messages from macOS or from an app.log stream with a predicate.Caxton opens files. It does not read the unified log.

For the wider choice of tools, choosing a log viewer for Mac sets Console, the Terminal tools and the dedicated viewers side by side, and how to open a 10 GB log file on a Mac covers reading, searching and editing a log of that size once it is on your Mac.

Open a large log as Tail, click Follow, and scroll up whenever you need to read what went past.

Download Caxton for Free

7-day free trial of Caxton Pro, every feature, no credit card required. After it, Caxton Free keeps opening, searching and filtering at any size, and you can edit and save files up to 10 MB as text.

Frequently asked questions

How do I follow a log file on a Mac?

To follow a log file on a Mac, open Terminal and run tail -f followed by the file's name, which prints each new line as it is written until you press Control-C. Use tail -F when the log is rotated, and less +F when you also want to scroll back and search. Caxton, a native Mac editor for text and data files, follows a log of 300 MB or more: open the file, choose Tail in the Open Large File dialog, click Open, then click Follow in the toolbar.

What is the difference between tail -f and tail -F?

Both print new lines as they are written. tail -f keeps reading the file it opened, so when the log is rotated, which renames the file and starts a new one under the old name, it prints nothing more. tail -F checks whether the name now belongs to a different file and reopens it, so it carries on into the new log. In a test with a log rotated after its tenth line, tail -f printed 10 lines and tail -F printed all 21.

How do I stop tail -f or get out of less +F?

Press Control-C. In tail that ends the command and returns you to the prompt. In less, Control-C only stops the following: less stays open on the file so you can scroll back and search, pressing F starts following again, and pressing q quits.

Why does grep print nothing when I pipe tail -f into it?

grep is holding its output in a buffer. Its manual page gives the rule: output is line buffered when it goes to a terminal and block buffered otherwise, so matches sent on to a file or to another command are released in batches. Add --line-buffered, as in tail -f app.log | grep --line-buffered ERROR, and each matching line is passed on as soon as it is found.

Can Caxton follow a log file as it grows?

Yes, for a file of 300 MB or more. Open it, choose Tail in the Open Large File dialog, and click Follow in the toolbar. The view stays on the end of the file, scrolling up pauses it, and a rotated log brings up a sheet with Follow New File and Stay on Old. All of that works on Caxton Free. A file under 300 MB opens whole and is reloaded when it changes on disk, without Follow, so tail -f or less +F is the better tool for a small log.

Sources