-
-
Notifications
You must be signed in to change notification settings - Fork 2
Linux readlink Guide
Mattscreative edited this page Dec 5, 2025
·
3 revisions
Complete beginner-friendly guide to readlink on Linux, covering Arch Linux, CachyOS, and other distributions including symbolic link resolution, link target reading, and path resolution.
Basic usage:
# Read link target
readlink symlink
# Shows target of symbolic linkFull path:
# Absolute path
readlink -f symlink
# -f = canonicalize (follows all links)Basic link:
# Read link
readlink /path/to/symlink
# Output: target pathRelative target:
# Relative link
readlink symlink
# Shows relative target pathCanonical path:
# Follow all links
readlink -f symlink
# -f = canonicalize (resolves all links)Real file path:
# Get real path
readlink -f /path/to/link
# Returns absolute path to real fileLink chains:
# Follow link chain
readlink -f link1
# Resolves: link1 -> link2 -> targetDon't follow:
# Don't follow (default)
readlink symlink
# Shows immediate target onlyCheck installation:
# readlink is part of coreutils
# Usually pre-installed
# Check readlink
which readlinkThis guide covered readlink usage, symbolic link resolution, and path resolution for Arch Linux, CachyOS, and other distributions.
- realpath Guide - Absolute path resolution
- ln Guide - Create links
- File Operations - File management
-
readlink Documentation:
man readlink
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.