cd /news/developer-tools/realpath · home topics developer-tools article
[ARTICLE · art-71100] src=graybeard.ing ↗ pub= topic=developer-tools verified=true sentiment=· neutral

realpath

A developer documents the Unix command 'realpath' for outputting the absolute path of a file, noting its utility when referencing file paths for large language models (LLMs). The author suggests aliases like 'ap' or 'abspath' for convenience.

read1 min views1 publishedJul 23, 2026

Quick note post. I wanted to document this handy little Unix command for spitting out the absolute path of a file:

cd ~/projects/<project>/docs
ls
thing.md
realpath thing.md
/path/to/home/projects/<project>/docs/thing.md

So, if thing.md

lives at ~/projects//docs/thing.md, we'd get something like...

/path/to/home/projects/<project>/docs/thing.md

Especially when dealing with LLMs (needing to reference paths on your machine for the LLM to read), this is a handy one to have floating around your brain.

My only gripe is this has that old school linux command naming style when it should be something like ap

or abspath

. Aliases to the rescue!

alias ap="realpath"
alias abspath="realpath"
alias absolute_path="realpath"

Pop this in your Bash or ZSH config and open a new terminal:

cd ~/projects/<project>/docs
ls
thing.md
ap thing.md
/path/to/home/projects/<project>/docs/thing.md

Enjoy!

── more in #developer-tools 4 stories · sorted by recency
signetai.sh · · #developer-tools
Untitled
── more on @unix 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/realpath] indexed:0 read:1min 2026-07-23 ·