Results 1 to 8 of 8

Thread: what does the "$" sign mean in the terminal

  1. #1
    Join Date
    Mar 2010
    Beans
    723
    Distro
    Ubuntu 12.04 Precise Pangolin

    what does the "$" sign mean in the terminal

    I've always wondered about this what does the "$" indicate in the terminal/command line
    Antec 300 Illusion__________MSI 770-G45 AM3
    AMD X6 3.0Ghz____________4gig ddr3 1600 GSKILL
    1tb Seagate hd____________ATI 5850 xfx(OC soon)
    _____________750w diablotek psu_______________

  2. #2
    Join Date
    Jun 2011
    Location
    The Shadow Gallery
    Beans
    6,770

    Re: what does the "$" sign mean in the terminal

    Quote Originally Posted by oleink View Post
    I've always wondered about this what does the "$" indicate in the terminal/command line
    means a normal user, some unix systems end the prompt with % which means same thing.

    # means a root user
    Backtrack - Giving machine guns to monkeys since 2006
    Kali-Linux - Adding a grenade launcher to the machine guns since 2013

  3. #3
    Join Date
    Feb 2009
    Beans
    536
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: what does the "$" sign mean in the terminal

    Quote Originally Posted by oleink View Post
    I've always wondered about this what does the "$" indicate in the terminal/command line
    Pretty much it's just there as a separator between the prompt and what you actually type. It's like the > in a Windows/DOS prompt.

    Code:
    username@computer:~$
    on Linux (or any other system that uses bash or a similar shell) is pretty much the same as:

    Code:
    C:\My Documents>
    on Windows.

  4. #4
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: what does the "$" sign mean in the terminal

    Traditionally, a shell prompt either ends with $, % or #. If it ends with $, this indicates a shell that's compatible with the Bourne shell (such as a POSIX shell, or a Korn shell, or Bash). If it ends with %, this indicates a C shell (csh or tcsh). If it ends with #, this indicates that the shell is running as the system's superuser account (root), and that you should be extra careful.

    Prompts are often highly individualized. Your Bash prompt will probably be much longer than $.

    Also in Bash, $ usually means "Expand". It is not part of your variable name! You can expand "$variable" content, "$(command)" output or "$((arithmetic))" results.

    Used as a special parameter $ expands to the PID of the shell: echo $$

    Bash also supports $"..." quoting syntax for locale-specific translation. If the current locale is C or POSIX, the dollar sign is ignored. If the string is translated and replaced, the replacement is double-quoted.

    Bash also has a special form of quoting, $'string' in which backslash-character combinations are expanded. For example, echo $'this is a literal tab: \t'

    $[...] is an obsolete, deprecated syntax for math.

  5. #5
    Join Date
    Jan 2009
    Location
    Nelspruit, South Africa
    Beans
    1,417
    Distro
    Ubuntu Development Release

    Re: what does the "$" sign mean in the terminal

    gee I wanted to know too. thanks
    Monitor: LG flatron w1954s 22", mobo: G31-m7 series, CPU: Intel LGA 775 Intel core duo 2 2,66GHZ, RAM: 3GB, GPU: ATI Radeom HD 2400, Storage: 500GB SATA and 80GB IDE, Windows 7 ultimate and Ubuntu

  6. #6
    Join Date
    Feb 2009
    Beans
    536
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: what does the "$" sign mean in the terminal

    Quote Originally Posted by sisco311 View Post
    If it ends with %, this indicates a C shell (csh or tcsh).
    zsh also uses % and is fairly Bourne-shell-like, though it has a lot of influence from csh by way of tcsh and ksh. (Also, tcsh as it comes from the Ubuntu repositories uses > as its default prompt character).

  7. #7
    Join Date
    Mar 2010
    Beans
    723
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: what does the "$" sign mean in the terminal

    thanks a bunch guys! Very helpful
    Antec 300 Illusion__________MSI 770-G45 AM3
    AMD X6 3.0Ghz____________4gig ddr3 1600 GSKILL
    1tb Seagate hd____________ATI 5850 xfx(OC soon)
    _____________750w diablotek psu_______________

  8. #8
    Join Date
    Jun 2011
    Location
    The Shadow Gallery
    Beans
    6,770

    Re: what does the "$" sign mean in the terminal

    Quote Originally Posted by oleink View Post
    thanks a bunch guys! Very helpful
    dont forget to mark as solved using thread tools

    cheers
    Backtrack - Giving machine guns to monkeys since 2006
    Kali-Linux - Adding a grenade launcher to the machine guns since 2013

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •