BrandCrock | Gateway to Digital Brand

How to get full file path Linux? Get the absolute path of a file?

In this tutorial, we will guide you about how to get the Absolute Path of a File in the Linux Operating System and How to get full file path Linux.

Readlink linux command to get full file path Linux:

readlink command in Linux is used to print resolved symbolic links or canonical file names. Whenever we have a symbolic link and we want to know what full path it refers to. You could use the readlink command to display the actual path of the symbolic link.

Print value of a symbolic link or canonical file name.

Syntax:

readlink [OPTION]... FILE...
OPTION:
  -f, --canonicalize            canonicalize by following every symlink in
                                every component of the given name recursively;
                                all but the last component must exist
  -e, --canonicalize-existing   canonicalize by following every symlink in
                                every component of the given name recursively,
                                all components must exist
  -m, --canonicalize-missing    canonicalize by following every symlink in
                                every component of the given name recursively,
                                without requirements on components existence
  -n, --no-newline              do not output the trailing delimiter
  -q, --quiet
  -s, --silent                  suppress most error messages (on by default)
  -v, --verbose                 report error messages
  -z, --zero                    end each output line with NUL, not newline
      --help     display this help and exit
      --version  output version information and exit

Example

readlink -f myfile.txt

Output

/home/user/dos2021/myfile.txt

More from our latest blogs

Visual comparison of building vs buying software features — a glowing gear in one hand for custom builds, and a polished sphere in the other hand for off-the-shelf solutions.

Build or Buy? Rethinking Custom vs Off-the-Shelf Features in 2025

It’s a question that comes up in nearly every strategy call, stakeholder meeting, or MVP

E-Commerce Vaid Ali Jul 25, 2025
5-Reasons-Your-API-Heavy-Store-Feels-Slower-Than-Expected.

5 Reasons Your API-Heavy Store Feels Slower Than Expected

We’ve seen it happen more than once. A store gets rebuilt using the latest stack,

E-Commerce Vaid Ali Jul 18, 2025

The Hidden Cost of Too Many Plugins: How to Audit & Clean Your Stack

Too many plugins can quietly slow down your site, weaken security, and cause unexpected errors.

E-Commerce Vaid Ali Jul 11, 2025

From Headless to Helpless? Fixing Common Build Mistakes in 2025

Not long ago, going headless was the upgrade everyone talked about — faster sites, total

Uncategorized zubair zubair Jul 3, 2025
1 2 3 4 41
Scroll to Top