How to obtain the absolute path of a file via Shell (BASH/ZSH/SH)? September 10, 2022 by Tarik Use realpath $ realpath example.txt /home/username/example.txt