InfinityQuest - Programming Code Tutorials and Examples with Python, C++, Java, PHP, C#, JavaScript, Swift and more

Menu
  • Home
  • Sitemap

Python Programming Language Best Tutorials and Code Examples

Learn Python Right Now!
Home
Bash
Decoding the Prompt in bash
Bash

Decoding the Prompt in bash

InfinityCoder January 11, 2017

You’d like to know what all the punctuation on your screen means.

All command-line shells have some kind of prompt to alert you that the shell is ready to accept your input.

What the prompt looks like depends on many factors including your operating system type and version, shell type and version, distribution, and how someone else may have configured it.

In the Bourne family of shells, a trailing $ in the prompt generally means you are logged in as a regular user, while a trailing # means you are root.

The root account is the administrator of the system, equivalent to the System account on Windows (which is even more powerful than the Administrator account), or the Supervisor account on Netware.

root is all-powerful and can do anything on a typical Unix or Linux system.
Default prompts also often display the path to the directory that you are currently in; however, they usually abbreviate it. So a ~ means you are in your home directory.
Some default prompts may also display your username and the name of the machine you are logged into.

If that seems silly now, it won’t when you’re logged into five machines at once possibly under different usernames.
Here is a typical Linux prompt for a user named jp on a machine called adams, sitting in the home directory. The trailing $ indicates this is a regular user, not root.

1
jp@adams:~$

Here’s the prompt after changing to the /tmp directory. Notice how ~, which really meant /home/jp, has changed to /tmp.

1
jp@adams:/tmp$

The shell’s prompt is the thing you will see most often when you work at the command line, and there are many ways to customize it more to your liking.

But for now, it’s enough to know how to interpret it. Of course, your default prompt may be different, but you should be able to figure out enough to get by for now.
There are some Unix or Linux systems where the power of root may be shared, using commands like su and sudo.

Or root may not even be all-powerful, if the system is running some kind of mandatory access control (MAC) system such as the NSA’s SELinux.

Share
Tweet
Email
Next Article

Related Articles

Clearing All Aliases in bash
You need to make sure that there are no malicious …

Clearing All Aliases in bash

“Daemon-izing” Your Script in bash
Sometimes you want a script to run as a daemon, …

“Daemon-izing” Your Script in bash

About The Author

InfinityCoder
InfinityCoder

Leave a Reply

Cancel reply

Recent Tutorials InfinityQuest

  • Adding New Features to bash Using Loadable Built-ins in bash
    Adding New Features to bash Using Loadable …
    June 27, 2017 0
  • Getting to the Bottom of Things in bash
    Getting to the Bottom of Things in …
    June 27, 2017 0

Recent Comments

  • fer on Turning a Dictionary into XML in Python
  • mahesh on Turning a Dictionary into XML in Python

Categories

  • Bash
  • PHP
  • Python
  • Uncategorized

InfinityQuest - Programming Code Tutorials and Examples with Python, C++, Java, PHP, C#, JavaScript, Swift and more

About Us

Start learning your desired programming language with InfinityQuest.com.

On our website you can access any tutorial that you want with video and code examples.

We are very happy and honored that InfinityQuest.com has been listed as a recommended learning website for students.

Popular Tags

binary data python CIDR convert string into datetime python create xml from dict python dictionary into xml python how to create xml with dict in Python how to write binary data in Python IP Address read binary data python tutorial string as date object python string to datetime python

Archives

  • June 2017
  • April 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
Copyright © 2021 InfinityQuest - Programming Code Tutorials and Examples with Python, C++, Java, PHP, C#, JavaScript, Swift and more
Programming Tutorials | Sitemap