Ubuntu – Command not found $ (dollar sign)

command line

Any command that starts with $ returns

command not found

How can I fix this?

I am using 16.10 Ubuntu.

Best Answer

  • Presumably you are copying and pasting commands from somewhere that look like this:

    $ sudo apt update
    

    The $ sign is not part of the command at all - it is a commonly used way to indicate that the text following it is a command. Typically here on Ask Ubuntu we use it when we want to indicate "I entered this command, and the output was this". It is an abbreviation of the full prompt we actually see:

    zanna@monster:~$ $ sudo apt update
    $: command not found
    

    It can also be used to mean (on Ubuntu Forums for example) "run the command as a normal user", not root, because when you switch to root the prompt changes:

    zanna@monster:~$ sudo -i
    [sudo] password for zanna: 
    root@monster:~#
    

    The $ is not meant to be entered. The actual command would be

    sudo apt update
    
  • Related Question