Back to commands

Hosting Operations

Read-only, can be slow

Audit a Symlink Permission Chain

You need to inspect symlink targets and every parent directory before deciding whether permissions are wrong.

Command

find fixtures/perm-audit -type l -printf '%p -> %l\n' -exec namei -l {} \;

Before you run this

System impact: Read-only. Can create load on large logs, directories, filesystems, or process tables.

When not to use it: Do not audit only the symlink inode; access depends on the target path too.

Expected output

Each symlink target followed by namei ownership and mode details.

System impact

Read-only, can be slow. Nothing changes. The command lists symlinks and traces their resolved path components.

Scope this to the smallest useful path or service on busy systems.

Recovery / rollback: no state is changed.

When to use it

Use when current-release, shared-secret, or uploads symlinks complicate a permission issue.

When not to use it

Do not audit only the symlink inode; access depends on the target path too.

Explanation-only example

Illustrated output, not a live lab run

This example is intentionally illustrative. It shows the command shape without killing real processes or changing your machine.

demo@lab:~$

$ find sample-files/perm-audit -type l -printf '%p -> %l\n' | sort

sample-files/perm-audit/current/app -> ../releases/2026-06-25
sample-files/perm-audit/releases/2026-06-25/config/prod.token -> ../../../shared/secrets/prod.token

$ find sample-files/perm-audit -type l -printf '%p -> %l\n' -exec namei -l {} \;

sample-files/perm-audit/current/app -> ../releases/2026-06-25
f: sample-files/perm-audit/current/app
drwxr-xr-x root root fixtures
drwxr-xr-x root root perm-audit
drwxr-xr-x root root current
lrwxrwxrwx root root app -> ../releases/2026-06-25
drwxr-xr-x root root   ..
drwxr-xr-x root root   releases
drwxr-xr-x root root   2026-06-25
sample-files/perm-audit/releases/2026-06-25/config/prod.token -> ../../../shared/secrets/prod.token
f: sample-files/perm-audit/releases/2026-06-25/config/prod.token
drwxr-xr-x root root fixtures
drwxr-xr-x root root perm-audit
drwxr-xr-x root root releases
drwxr-xr-x root root 2026-06-25
drwxr-xr-x root root config
lrwxrwxrwx root root prod.token -> ../../../shared/secrets/prod.token
drwxr-xr-x root root   ..
drwxr-xr-x root root   ..
drwxr-xr-x root root   ..
drwxr-xr-x root root   shared
drwxr-xr-x root root   secrets
-rw------- root root   prod.token
View commands shown

These are the commands shown in the sanitized transcript.

Commands shown

  1. find fixtures/perm-audit -type l -printf '%p -> %l\n' | sort
  2. find fixtures/perm-audit -type l -printf '%p -> %l\n' -exec namei -l {} \;

next steps

Related commands

Hosting Operations Can be slow

Find Release Files Writable Outside the Owner

A release file that someone besides the owner can modify deserves a second look.

find fixtures/perm-audit/releases/2026-06-25 -type f -perm /0022 -printf '%M %u:%g %p\n' | sort
Hosting Operations Can be slow

Group Writable Files by Owning Group

Group-writable files are not automatically wrong, but the owning group decides the risk.

find fixtures/perm-audit -type f -perm -0020 -printf '%g %M %p\n' | sort
Hosting Operations Can be slow

Find Runtime Directories Writable Outside the Owner

Runtime directories often need writes, but the write boundary should be visible.

find fixtures/perm-audit/releases/2026-06-25/storage fixtures/perm-audit/releases/2026-06-25/uploads -type d -perm /0022 -printf '%M %u:%g %p\n' | sort
Hosting Operations Can be slow

Show Enabled Apache Sites

The Apache config existed. The enabled symlink did not.

find fixtures/apache/sites-enabled -maxdepth 1 -type l -printf '%f -> %l\n' | sort
Hosting Operations Can be slow

Summarize Cache File Ages

Cache cleanup is safer when you know whether files are stale or still active.

find /lab/disk-inode-cleanup/var/cache/app -xdev -type f -printf '%TY-%Tm-%Td\n' | sort | uniq -c
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.

  • lpic1:103-gnu-unix-commands
  • lpic1:104-filesystems-permissions-fhs
  • lfcs:essential-commands
  • lfcs:operations-deployment
  • lfcs:services-logs
  • lfcs:storage
  • linuxplus:automation-scripting
  • linuxplus:provisional
  • linuxplus:system-management
  • risk:read-only

Useful for

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

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