Ubuntu – A terminal and how to open and use it

command line

  • What is a terminal?
  • How do I open a terminal window?
  • How do I use the terminal?

Best Answer

  • What is it:

    The terminal is an interface in which you can type and execute text based commands.

    terminal screenshot


    Why use it:

    It can be much faster to complete some tasks using a Terminal than with graphical applications and menus. Another benefit is allowing access to many more commands and scripts.

    A common terminal task of installing an application can be achieved within a single command, compared to navigating through the Software Centre or Synaptic Manager.

    For example the following would install Deluge bittorrent client:

    sudo apt-get install deluge
    

    To save a detailed list of files in the current directory tree to a file called listing.txt:

    find -type f > listing.txt
    

    Sometimes you will also see the following notation:

    $ whoami
    calum
    $ ls
    Downloads  Documents
    

    This means that the command whoami is executed which gives calum as output. Following that command, ls is executed which outputs Downloads Documents.

    A similar notation is:

    # apt-get update
    

    This means that the command should be run as root, that is, using sudo:

    $ sudo apt-get update
    

    Note that the # character is also used for comments.

    # this command will give your username
    whoami
    # the next command will show the contents of the current directory
    ls
    

    How do I open a terminal:

    • Open the Dash (Super Key) or Applications and type terminal

      enter image description here

    • Use the keyboard shortcut by pressing Ctrl+Alt+T.

    • For older or Ubuntu versions: (More Info)

      Applications → Accessories → Terminal


    Alternative names for the terminal:

    • Console
    • Shell
    • Command line
    • Command prompt

    (Although technically they mean different things)


    Common commands & Further information

  • Related Question