UNIX / Linux: Absolute Pathnames

Posted on in Categories , , , , , , , , , , , , last updated August 15, 2007

Q. Can you explain the term absolute pathname under UNIX or Linux oses?

A. An absolute pathname, is the location of a filesystem object relative to the root directory. All absolute pathnames always begin with a slash (/). With Absolute pathname you have access to complete file system objects such as directories and files.

Absolute Pathnames

You can use absolute pathnames to specify full file path such as /etc/passwd. It is believed that UNIX pathname looks and feels like Internet addresses, thus result into compatibility. The absolute pathname of the current directory can be found by using the pwd command:

Absolute Pathnames Examples

Try following commands:
ls /etc
ls /usr/share/games
cd /usr/share/games
cd ~
cat /etc/passwd
cp /etc/passwd /tmp
cd /tmp
cat passwd