Skip to main content
IBM 
ShopSupportDownloads
IBM HomeProductsConsultingIndustriesNewsAbout IBM
IBM : developerWorks : Linux : Education - Tutorials
LPI certification 101 exam prep, Part 2
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackPreviousNext
3. FHS and finding files
  


The PATH page 5 of 21


When you run a program at the command line, bash actually searches through a list of directories to find the program you requested. For example, when you type ls, bash doesn't intrinsically know that the ls program lives in /usr/bin. Instead, bash refers to an environment variable called PATH, which is a colon-separated list of directories. We can examine the value of PATH:


$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin

Given this value of PATH (yours may differ), bash would first check /usr/local/bin, then /usr/bin for the ls program. Most likely, ls is kept in /usr/bin, so bash would stop at that point.


Main menuSection menuFeedbackPreviousNext
PrivacyLegalContact