Navigate and inspect

pwd

ls -lah

cd /var/www

find . -name "*.php"

Read and search logs

less /var/log/syslog

tail -f /var/log/nginx/error.log

grep -n "ERROR" application.log

Log locations vary by distribution and service configuration.

Permissions

chmod 640 config.php

chown appuser:www-data storage/

Understand owner, group and other permissions. Avoid broad chmod -R 777 fixes.

Processes and disk

ps aux

top

df -h

du -sh /var/www/*

free -h

Network troubleshooting

ip addr

ss -tulpn

curl -I https://example.com

ping -c 4 1.1.1.1

Some commands need elevated privileges or may be missing from minimal containers.

Practise safely

Use a test VM or container. Be careful with rm, recursive permission changes, service restarts and commands using sudo.