Absolute and relative pathnames

Updated: April 19, 2023

There are two types of pathname:

Absolute paths
Pathnames that begin with a slash specify locations that are relative to the root of the pathname space (/). For example, /home/fred/my_apps/favs.
Relative paths
Pathnames that don't begin with / specify locations relative to your current working directory.

For example, if your current directory is /home/fred, a relative path of my_apps/favs is the same as an absolute path of /home/fred/my_apps/favs.

You can't tell by looking at a pathname whether the path points to a regular file, a directory, a symbolic link, or some other file type. To determine the type of a file, use file or ls -ld.

The one exception to this is a pathname that ends with /, which always indicates a directory. If you use the -F option to ls, the utility displays a slash at the end of a directory name.