Find the largest files in a directory
find . -type f -exec du -h {} + | sort -rh | head -n 20Run it before deleting anything. du reports space on disk, so sparse files look smaller than ls says.
Shell commands for everyday Linux administration that each do one job. Copy one straight from this page — the note under each says what it changes and where it differs on macOS.
find . -type f -exec du -h {} + | sort -rh | head -n 20Run it before deleting anything. du reports space on disk, so sparse files look smaller than ls says.
sudo find / -xdev -type f -exec du -h {} + | sort -rh | head -n 20-xdev keeps it off /proc and network mounts. It reads every inode, so give it minutes.
du -h -d 1 . | sort -rhTotals per folder rather than per file — the quicker way to pick which tree to dig into.
sudo ss -tulpnWithout sudo the process column is empty for other users' sockets, which reads as nothing listening.
sudo ss -tlpn 'sport = :8080'The answer to "address already in use". A socket on 127.0.0.1 is reachable only from this host.
sudo lsof -nP -iTCP:8080 -sTCP:LISTENmacOS has no ss. lsof is the equivalent there and works on Linux as well.
journalctl -u nginx -fCtrl+C stops it. A service that writes its own log file will not appear here.
journalctl -u nginx -f -n 100Enough history to see what happened just before you attached.
journalctl -u nginx -p err --since "1 hour ago"-p err drops the info and debug lines; --since takes plain English like "10 min ago".
systemctl --failedThe first command to run on a box that came up wrong.