What does $ mean in the terminal window?

Asked by Esther Strom

This may be a stupid question, but I'm a total beginner with Linux and although I've googled, I'm not sure I'm asking the right question.

I'm trying to build a version of a dev environment that isn't available via the Software Center. There are instructions on the Ubuntu Forums (older, closed thread). Most of it I understand, like this:

sudo apt-get install build-essential checkinstall libart-2.0-dev libaspell-dev

But the next chunk of code looks like this:

$ cd $HOME
$ wget http://www.bennewitz.com/bluefish/stable/source/bluefish-2.0.0.tar.bz2
$ tar xjvf bluefish-2.0.0.tar.bz2

What do the $ symbols mean at the beginning of the lines? Can I just copy and paste the entire line like I did the other code, or does the $ refer to a system variable or something that I need to replace with my own file system locations?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
delance
Solved:
Last query:
Last reply:
Revision history for this message
Greg Beam (ki7mt) said :
#1

The $HOME is a variable, and in this case it's your /home/user_name directory. It's a shot-cut basically. Open a terminal window and type the follow and look at it's output:

ls $HOME

You should see a list of directories and files that are under you /home/user_name something like:

Desktop, Downloads, Music, Public, Videos Documents etc etc.

The instructions are putting you in your home directory before you download the file.

Then after the wget command, you decompress the file with TAR.

Simple explanation of variables: http://www.ibm.com/developerworks/library/l-bash.html

Bash Guide for Beginners: http://linuxreviews.org/beginner/Bash-Beginners-Guide/
(See section 3.2 for variables).
.

Revision history for this message
Best delance (olivier-delance) said :
#2

https://launchpad.net/~ke1ha explained you what is a variable.
But perhaps you want to know what is $ at start of line.
It's a prompt, to show to user that computer waits a command.
Usually, you get "$" is you are a user and "#" is your are administrator.
It can be configured.

And in bash script, you must not add the prompt.

Revision history for this message
Esther Strom (esthermstrom-gmail) said :
#3

Thanks delance, that solved my question.

Revision history for this message
Esther Strom (esthermstrom-gmail) said :
#4

@ke1ha, that's really helpful to know. In this particular case, though, I think delance answered the question.