Labthrift Labthrift What to buy. What to skip. Why.

Written 1 Sep 2026. This is a how-to, not a product card.

See the shortcut target

After dirname, readlink prints the shortcut target so a practice shortcut shows the path it points at. You don't need extra system software for this.

See the folder path printed the folder path of a name. Tonight you ask where a shortcut points: readlink. Readlink prints the path a shortcut points at. Start with one tiny practice file, one shortcut, then readlink ~/readlink-link.txt.

You are still only practicing in home on the computer. The computer does not need extra system software, htop, Grafana, or a NAS for this one job.

Skip until SSH already works

SSH from the couch should already get you a prompt. SSH means type commands from your laptop, on the house network. If making the shortcut is what you want, that is make a shortcut. If the full path is what you want, that is see full path. If the folder path is what you want, that is see the folder path.

What this is

readlink prints the path a shortcut points at. You make one tiny practice file, one shortcut with ln -s, then type readlink ~/readlink-link.txt. Stick with that safe peek. You don't need extra system software for this.

It is not ln as the job. Ln makes the shortcut. Tonight uses ln -s only to make the practice shortcut. It is not realpath. Realpath prints the full path. Skip readlink -f as the realpath job. It is not dirname. Dirname prints the folder path.

Practice readlink in home

SSH into the computer.

Make sure home is where you sit:

pwd

You want a path that ends in your login name.

If the path is wrong, run this:

cd ~

Make one tiny practice file:

printf 'hello\n' > ~/readlink-a.txt

Make one practice shortcut that points at that file:

ln -s ~/readlink-a.txt ~/readlink-link.txt

Print the shortcut target (tonight's job):

readlink ~/readlink-link.txt

You want the path the shortcut points at, typically /home/YOURLOGIN/readlink-a.txt or ~/readlink-a.txt as stored. Then the prompt back. That is enough for tonight. Practice only in home on the computer.

Debian and Ubuntu usually already have readlink (coreutils). Don't make apt the job.

If readlink is missing, install coreutils:

sudo apt install coreutils

Then stop. That apt line is not the lesson.

When you are done looking, throw the practice names away with careful delete only. Delete the shortcut first, then the file. That is delete a file carefully. Skip rm -rf.

rm -i ~/readlink-link.txt

rm -i ~/readlink-a.txt

Useful extras, still home only

Optional extra: readlink without a trailing newline:

readlink -n ~/readlink-link.txt

That peek prints the same target path without a trailing newline. Don't make -n required. You can stay on readlink ~/readlink-link.txt.

Optional extra: readlink on a regular file (not a shortcut):

readlink ~/readlink-a.txt

That peek typically prints nothing and exits 1. That peek shows readlink is for shortcuts. Don't make that required.

Skip readlink -f, readlink -e, and readlink -m as this job. Those flags follow shortcuts to a full path. That is the realpath job. That is see full path.

Skip huge dumps as this job. Skip readlink piped into rm. Readlink prints a shortcut target. Rm deletes files. Don't mix those jobs. Skip files under /etc, whole /, SSH folders, USB sticks, and /srv. Practice only in home.

Skip screen, tmux, htop, Grafana, and a NAS. Keep SSH on the house network: keep the computer on the house network. Don't forward port 22.

What this is not

This is not ln as the job. Ln makes the shortcut. That is make a shortcut. It is not realpath. That is see full path. It is not dirname. That is see the folder path.

What next

Need a unique temporary practice file? Make a temporary practice file. Need the last name from a path? See last name.

Skip

Sources

Debian: readlink(1). Ubuntu: readlink(1). Official pages only. For making a shortcut, see make a shortcut. For the full path, see see full path. For the folder path, see see the folder path. For the login, see SSH from the couch.

Also on this topic

SSH from the couchType commands on the computer from your laptop, on the house network. Password login first. Don't open this to the internet. See the folder pathAfter basename, dirname prints the folder path of a name, without the last name. You don't need extra system software for this. See last nameAfter realpath, basename prints the last name of a path, without the folders. You don't need extra system software for this. See full pathAfter cmp, realpath shows the full path so practice files and shortcuts show where names actually live. You don't need extra system software for this. Make a shortcutAfter SSH works, ln -s makes a shortcut so a second name points at the same file. You don't need a file manager app for this. See which folder you are inAfter SSH works, pwd prints the folder you are sitting in so later file commands land where you expect. You don't need a file manager app for this. See what's in a folderAfter SSH works, ls lists folder contents so you know what names are there. You don't need a file manager app for this. Delete a file carefullyAfter SSH works, delete one file with rm -i. Ask first. Skip rm -rf. You don't need a NAS for this. Turn off password login once the key worksAfter the laptop key login is boring, tell SSH to stop accepting the password. The key is how you get in. A keyboard on the computer is the backup now. Keep the computer on the house networkSSH and Pi-hole belong on the house network. Skip this if you never opened the router settings. Don't forward port 22.