How Do I Find the Relative Path in Linux?
Contents
Command Description Path
./simple.sh Run script from current directory Use relative path

What is the relative path in Linux?

Relative path is defined as the path related to the present working directly(pwd). It starts at your current directory and never starts with a / .

How do I find the path of a file in Linux?

On Linux: You can use the command realpath yourfile to get the full path of a file as suggested by others.

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest