Apple Terminal
Read-only, can be slowWatch a Log or Build File Update
A developer or creator needs to monitor a changing log, export report, or build output file.
Command
tail -f ./app.log
Before you run this
System impact: Read-only. Can create load on large logs, directories, filesystems, or process tables.
When not to use it: Do not use it for binary media files or huge one-time analysis. It follows appended text.
Expected output
Existing tail lines followed by new lines as the file is appended.
System impact
Read-only, can be slow. Nothing changes. The command keeps the terminal attached and prints new lines as they appear.
Scope this to the smallest useful path or service on busy systems.
When to use it
Use for local logs, generated reports, build output, and simple text-based progress checks.
When not to use it
Do not use it for binary media files or huge one-time analysis. It follows appended text.
Recovery / rollback
Press Ctrl-C to stop following the file.
Explanation-only example
Illustrated output, not a live lab run
This example is intentionally illustrative. It shows the command shape without killing real processes or changing your machine.
$ tail -n 1 project/logs/app.log
exit
$ printf '%s\n' 'request GET /health' >> project/logs/app.log; tail -n 2 project/logs/app.log
exit
request GET /health
View commands shown
These are the commands shown in the sanitized transcript.
Commands shown
tail -n 1 project/logs/app.logprintf '%s\n' 'request GET /health' >> project/logs/app.log; tail -n 2 project/logs/app.log
next steps
Related commands
Search a Log for Errors With Context
A wall of logs is useless until you pull the error and the lines around it.
grep -n -C 2 'ERROR' ./app.log
Find Large Files Inside a Project
Before committing, check whether a huge video, build artifact, or export slipped into your repo.
find . -type f -size +100M -print
Check a URL Without Downloading the Page
Before opening a broken page in five browsers, ask the server for headers.
curl -I https://example.com
Flush macOS DNS Cache
Changed DNS but your Mac still visits the old place? Flush the resolver cache.
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Stop the Process Blocking a Dev Port
Free a stuck dev port without hunting through Activity Monitor.
lsof -ti tcp:3000 | xargs kill
Study mapping
Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.
Useful for
- LPIC-1 style command-line practice
- LFCS style performance tasks
- Linux+ style troubleshooting review
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.