↑ ↓ select, Enter open, Esc close

#logs

15 one-liners with this tag.

All one-liners tagged logs

Empty a file without deleting it

$truncate -s 0 -- /var/www/vhosts/example.com/logs/error_log
destructiveFilesystem

Check the Plesk installer log after a failed update

#tail -n 100 /var/log/plesk/install/autoinstaller3.log
harmlessPlesk

Check whether Apache hit MaxRequestWorkers

#grep -i "MaxRequestWorkers" /var/log/apache2/error.log* | tail -20
harmlessApache

Find permanently rejected emails in the mail log

#grep "status=bounced" /var/log/maillog | tail -n 20
harmlessMail

Find the cause of a 502 Bad Gateway in the nginx log

#grep -E "upstream|connect\(\) failed" /var/log/nginx/error.log | tail -20
harmlessnginx

Follow Docker container logs live

#docker logs -f --tail 100 app
harmlessDocker

Follow the Apache error log in real time

#tail -f /var/log/apache2/error.log
harmlessApache

Follow the LiteSpeed error log in real time

#tail -f /usr/local/lsws/logs/error.log
harmlessLiteSpeed

Follow the logs of all services in a Compose stack

#docker compose -f /opt/app/compose.yaml logs -f --tail 100
harmlessDocker

Follow the Plesk panel log in real time

#tail -f /var/log/plesk/panel.log
harmlessPlesk

Show Docker container logs for a time range

#docker logs -t --since 2h --until 1h app
harmlessDocker

Show nginx errors of a Plesk domain (502, 504)

#tail -n 50 /var/www/vhosts/system/example.com/logs/proxy_error_log
harmlessPlesk

Trace delivery for an email address in the mail log

#grep -i "info@example.com" /var/log/maillog | tail -n 50
harmlessMail

Verify a real Googlebot via reverse DNS

$n=$(host 66.249.66.1 | awk '/pointer/ {print $NF}'); echo "PTR: $n"; host "$n"
harmlessSEO checks

View PHP errors in the LiteSpeed stderr log

#tail -n 50 /usr/local/lsws/logs/stderr.log
harmlessLiteSpeed

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.