Back to commands

Linux Survival Basics

Read-only

Check Web File Owner and Mode

You need owner, group, and mode for one web file.

Command

stat -c '%A %U:%G %n' /srv/www/site/index.html

Before you run this

System impact: Read-only. Low when scoped to the shown target.

When not to use it: Do not change owner or mode before confirming the Nginx worker user.

Expected output

Mode, owner, group, and path for the target file.

System impact

Read-only. Nothing changes. The command reads current state and prints diagnostic evidence.

Recovery / rollback: no state is changed.

When to use it

Use after tracing parent directories.

When not to use it

Do not change owner or mode before confirming the Nginx worker user.

Example run

Commands shown

These are the commands shown for inspection. Treat them as an example, not proof that your system will behave identically.

  1. stat -c '%A %U:%G %n' /srv/www/site/index.html
  2. stat -c '%A %U:%G %n' /srv/www/site/index.html

next steps

Related commands

Linux Survival Basics Read-only

Check Owner and Mode in One Line

The file existed. The owner and mode explained why it still failed.

stat -c '%A %U:%G %n' /var/www/example/index.html
Linux Survival Basics Can be slow

Find Nginx root alias and access rules

One deny or alias can explain the whole 403.

grep -RInE 'root|alias|deny|allow' /etc/nginx/sites-enabled /etc/nginx/conf.d 2>/dev/null

next diagnostic step

Where to go from this command

Study mapping

Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.

  • LPIC-1 style command-line practice
  • LFCS style performance-task practice
  • Linux+ style troubleshooting review

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.