RSS Subscription
Linux Howtos & Tutorials

Enter your email:

Delivered by


NOTE:New tutorials are from LinuxCareer.com

Poll

Do you own or wish to have iPhone?
 


Linux eBooks FREE Download
A guide to programming Linux kernel modules
Introduction to Linux - A Hands on Guide
A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

SQLite 3 with PHP Essential Training – Free Video Training Tutorials

This guide will introduce you to the world of GNU/Linux

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide

Set up, maintain, and secure a small office email server

Partner Linux Sites:
How-To.LinuxCareer.com
Jobs.LinuxCareer.com
TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
All For Linux

Linux path environment variable

Article Index
1. Using Linux PATH variable
2. Adding a new directory into PATH variable

1. Using Linux PATH variable

Linux path environmental variable contains a list of directories in which the shell looks for executable programs every time you run a command or program. Use echo command to print your PATH variable:

$ echo $PATH
/home/lilo/bin:/usr/local/bin:/usr/bin:/bin:/usr/games

If the program / command is located within my PATH user do not need to include full path in order to execute a certain command. For example: date command is located within /bin:

$ which date
/bin/date

and /bin is defined in my PATH variable. Therefore, to execute date command is easy as:

$ date

2. Adding a new directory into PATH variable

From time to time you may need to add new directory into your PATH scope. The following example adds new directory /bin/myscripts into PATH variable:

$ echo $PATH
/home/lilo/bin:/usr/local/bin:/usr/bin:/bin:/usr/games
$ PATH=$PATH:/bin/myscripts
$ export PATH
$ echo $PATH
/home/lilo/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/bin/myscripts

Share this linux post:

Submit Linux path environment variable  in Delicious Submit Linux path environment variable  in Digg Submit Linux path environment variable  in FaceBook Submit Linux path environment variable  in Google Bookmarks Submit Linux path environment variable  in Stumbleupon Submit Linux path environment variable  in Technorati Submit Linux path environment variable  in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.


Linux eBooks FREE Download