unix_path - The PATH Variable After reading this document,...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
The PATH Variable After reading this document, you should know what the PATH variable is, how to set it, and how to view the directories currently therein. Motivation Consider the following UNIX terminal session: dbettis@rhino[~]$ ls ... When you type the command ls, the shell dutifully executes the command and returns the results to you. During the course of a terminal session, you type more commands. These include things like emacs, firefox, so on and so forth. But where do these commands come from? Obviously, they're included when you install the operating system, but where are they? The UNIX command which will tell you the full path to a binary it's about to execute. For example: dbettis@rhino[~]$ which ls /bin/ls That means that the exectuable for the command ls is located in /bin. Alternatively, to run ls, you can type in the full path to the command: dbettis@rhino[~]$ /bin/ls ... It seems like there's a bit of magic going on here, however. How does the system know that ls is in /bin? The way the system knows is the PATH
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/23/2012 for the course CS 348 taught by Professor Staff during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 3

unix_path - The PATH Variable After reading this document,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online