Back to commands

Hosting Operations

Read-only

Check the Current Release Symlink

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.

Watch this command run

Command transcript

This sanitized transcript shows the commands and output shape without exposing host details.

demo@lab:~$

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

/srv/www/example.com/releases/20260625T110000Z

$ find /srv/www/example.com/releases -maxdepth 1 -type d | sort

/srv/www/example.com/releases
/srv/www/example.com/releases/20260625T100000Z
/srv/www/example.com/releases/20260625T110000Z

$ curl -I http://localhost

HTTP/1.1 200 OK
server: lab-nginx
View commands shown

These are the commands shown in the sanitized transcript.

Commands shown

  1. readlink -f /srv/www/example.com/current
  2. find /srv/www/example.com/releases -maxdepth 1 -type d | sort
  3. curl -I http://127.0.0.1

next steps

Related commands

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 /lab/disk-inode-cleanup/home/deploy/current); find /lab/disk-inode-cleanup/home/deploy/releases -mindepth 1 -maxdepth 1 -type d ! -samefile "$current" -printf '%TY-%Tm-%Td %p\n' | sort
Hosting Operations Read-only

Check the Active Release Symlink

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

cd /lab/git-recovery-rollback && readlink releases/current && cat releases/current/VERSION
Hosting Operations Read-only

Check a Domain A Record

The site was fine. The domain was pointed somewhere else.

dig +short example.com A
Hosting Operations State change

Rollback a Release Symlink in a Sandbox

Practice the pointer switch where the blast radius is zero.

cd /lab/git-recovery-rollback && ln -sfn 2026-06-25-1000 releases/current
Web Server Rescue Read-only

Check the Current Release Symlink

One glance tells you which release directory production is pointing at.

readlink -f releases/current && ls -ld releases/current
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:operations-deployment
  • lfcs:services-logs
  • 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.