Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Under what circumstances do we prefix a $ symbol to a Linux/Unix directory name?

For instance:

cd $CVBLOB
share|improve this question

migrated from stackoverflow.com May 19 '11 at 15:53

This question came from our site for professional and enthusiast programmers.

1  
export CVBLOB=/tmp; cd $CVBLOB -> you will end up in /tmp – mihi May 19 '11 at 16:32
up vote 6 down vote accepted

The $ prefix means that the value is an environment variable.

For more information, see this article explaining environment variables in Linux.

share|improve this answer
    
So does it mean that the directory CVBLOB directly gets added to $PATH? – amal antony May 19 '11 at 15:32
2  
No, it means $CVBLOB is a variable in and of itself. Open up a terminal and type env. It'll show you a list of all the environment variables found. The $PATH variable is just one, although it's probably the most common. – Zach Rattner May 19 '11 at 15:33
2  
@user761350: No. And CVBLOLB is not a directory, it is a variable. – user49531 May 19 '11 at 15:33
    
@user761350: No. Maybe your $CVBLOB variable expands to something with, again CVBLOB in the name, like /opt/CVBLOB. But it needn't. So the answer to your original question is 'never'. A variable is prefixed with $, and the name is more or less free to chooose. And it isn't related to the path. You may extend your path with a literal name or an variable, like PATH=$PATH:$JAVA_HOME/bin or PATH=$PATH:/opt/jdk-1.6.20_26/bin` but you have to do it. There is no automatic DIR->VAR-PATH. – user unknown May 19 '11 at 15:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .