Beyond Bash builtins, GNU coreutils and friends (sed, awk, grep, find) form the text-processing toolkit. macOS ships BSD variants—flags may differ slightly.
coreutils highlights
ls --version 2>/dev/null || ls -G
df -h
du -sh .
stat README.md 2>/dev/null || stat -f %z README.mdCheck --help on Linux; on macOS read man pages for flag differences.
GNU vs BSD on macOS
Install GNU versions via Homebrew (brew install coreutils) as gls, greadlink, etc., when tutorials assume GNU flags—documented in Tools.
Composition reminder
find . -name "*.log" -size +1M -print0 | xargs -0 gzip -9Real pipelines combine find, xargs, and compression—test on sample data first.
Important interview questions and answers
- Q: Why GNU matters?
A: Linux CI and servers use GNU coreutils; macOS developers hit flag mismatches without g-prefixed tools. - Q: readlink -f?
A: GNU canonicalizes paths; macOS lacks -f—use Python or greadlink.
Self-check
- What brew package adds GNU coreutils on macOS?
- Why check --help before copying Linux examples?
Tip: On macOS, brew install coreutils gives GNU greadlink when tutorials use Linux flags.
Interview prep
- GNU vs BSD?
Flag differences on macOS vs Linux—check --help.
- greadlink?
GNU readlink via Homebrew on macOS.