↑ ↓ select, Enter open, Esc close

Find the most frequent 404 errors in the access log

Adjust the values, the command updates live
root@server
awk '$9 == 404 {print $7}' /var/www/vhosts/system/example.com/logs/access_ssl_log | sort | uniq -c | sort -rn | head -20

Filters all requests with status 404 and lists the 20 most frequent paths. Useful after a relaunch to find missing redirects, or to see which files bots are probing for. Many hits on wp-login.php or .env on non-WordPress sites are typical of scanners.

Also searched as

  • which pages return 404
  • find not found urls in access log
  • find broken links in log
  • analyze 404 errors apache

Related one-liners

All in Logs

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.