LINUX · Files & links · 8 min

Point current at a release

Create a relative symbolic link instead of copying a release directory.

Not completed

Your task

Create current as a symbolic link to releases/v1. Reading current/status.txt should use the original release file.

What you’re aiming for

  • readlink current prints releases/v1.
  • current/status.txt contains ready.
  • The release directory remains.

1. Prepare your practice folder

Use a Linux terminal, such as Ubuntu or WSL on Windows. These examples use Linux file permissions. In WSL, create your practice folder in your Linux home directory (~).

Create a new, empty folder for this exercise. If that name already exists, choose another new name. Continue only after you’re inside the new folder.

NEW PRACTICE FOLDER
mkdir opsrung-linux-create-release-link && cd opsrung-linux-create-release-link

Run these setup commands in that folder:

SETUP — RUN ONCE
mkdir -p releases/v1
printf '%s\n' 'ready' > releases/v1/status.txt

2. Try the task

Work toward the goal above. Start by inspecting the files or resources, then use a hint if you need one.

Hint 1

A symbolic link stores a path to another location.

Hint 2

The target is relative to the link’s parent directory.

Hint 3

Use ln -s releases/v1 current.

3. Review your result

Use these commands to look at your result and compare it with the goals. The website does not run or verify them.

REVIEW IN YOUR TERMINAL
ls -ld current
readlink current
cat current/status.txt

What you should see

  • readlink current prints releases/v1.
  • current/status.txt contains ready.
  • The release directory remains.

If your result differs: Compare the actual output with each goal. Keep your work inside this exercise’s folder and use only its named resources.

Compare with one possible solution
ONE POSSIBLE SOLUTION
ln -s releases/v1 current

Other approaches are fine if you reach the same goal. Opening this solution does not mark the exercise complete.

Finished this exercise?

You decide when you’re done. Your choice is saved in this browser, and you can change it later.