Most Linux prompts follow this basic structure:
The localhost and localdomain in the above example are placeholders for the names specific to your Linux login and directory location. The prompt varies slightly with different distros and settings, but this actual prompt (from Linux Mandrake) is representative:
The prompt ends with the $ symbol when you're logged in as a standard user. When you're logged in a root (or "administrator"), the prompt ends with the # symbol. (Note: In SuSE, when you're logged in as a standard user, the Bash prompt ends with a > symbol, like DOS.)
Linux Command-Line Nomenclature
When they're shown in printed instructions, Linux command-line commands entered from a terminal or console window start with the Linux prompt, which is represented as $ or #. The $ prompt tells you you're logged in as a standard user and the # prompt tells you that you're logged in as root. (See Linux Prompt Basics.)
The following command printed in instructions tells you to ensure that you're logged in as a standard user and then type "man help" and press Enter:
$ man help
The key point is: This nomenclature does not tell you to type "$ man help" and press Enter. Again, the $ prompt tells you where to start. You type what's after the $ prompt. Long-time DOS and Windows users are often confused by this way of explaining Linux commands, so it's important to get clear on it early on.
Logging in and out as Root
In Linux, you should not be logged in as "root," the all-powerful administrator to the operating system all the time. It's far too easy to accidentally damage your Linux installation. The prudent way to operate is to log in as Linux root when you need to for something specific and then log back out. This is easy to do. To log in, open a terminal or console window. Execute this command (remember, you don't type the "$"):
Linux will respond with this request to enter your root password:
Simply type your root password and press Enter. The prompt will now change so that it looks something like this:
If you've lost or forgotten your root password, please see Lost Password! for a tip on how to get it back.
To log out of root, either type "exit" on the command line and press Enter, or just press the Ctrl-D keyboard combination.