Back to commands

Hosting Operations

Read-only

Check the Nginx Site Symlink Target

You need to verify which release directory a site is serving.

Command

readlink -f /srv/www/example.com/current

Before you run this

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

When not to use it: Do not delete old releases until you know rollback requirements.

Expected output

The absolute path of the active release directory.

System impact

Read-only. Nothing changes. The command resolves the live symlink target.

Recovery / rollback: no state is changed.

When to use it

Use this after a deploy or rollback.

When not to use it

Do not delete old releases until you know rollback requirements.

next steps

Related commands

Hosting Operations Read-only

Check the Active Release Symlink

Git may say one thing while the release pointer serves another.

readlink /srv/www/example/current && cat /srv/www/example/current/VERSION
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 /srv/www/example/releases/current -type f -perm /0022 -printf '%M %u:%g %p\n' 2>/dev/null | sort
Hosting Operations Can be slow

Audit a Symlink Permission Chain

A symlink can make the path you audited different from the file the app opens.

find /srv/www/example -type l -printf '%p -> %l\n' -exec namei -l {} \; 2>/dev/null
Hosting Operations Can be slow

Exclude the Current Release from Cleanup

Release cleanup should prove what current points to before listing old directories.

current=$(readlink -f /home/deploy/current); find /home/deploy/releases -mindepth 1 -maxdepth 1 -type d ! -samefile "$current" -printf '%TY-%Tm-%Td %p\n' 2>/dev/null | sort
Hosting Operations Read-only

Rollback a Release Symlink in a Sandbox

Practice the pointer switch where the blast radius is zero.

ln -sfn /srv/www/example/releases/2026-06-25-1000 /tmp/linuxoneliners-current-release
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.

  • LFCS style performance-task practice

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