≡ Menu

unix pathname

UNIX / Linux: Absolute Pathnames

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:
pwd

Absolute Pathnames Examples

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