Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo
* * * * * 2 votes

Starting applications from the terminal in Ubuntu based distributions


  • Please log in to reply
2 replies to this topic

#1 Al1000

Al1000

  • Global Moderator
  • 7,969 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Scotland
  • Local time:09:44 PM

Posted 11 April 2015 - 07:14 PM

Starting applications from the terminal

Guide Overview

The purpose of this guide is to teach you about starting applications from the terminal. Most applications are started by clicking on menu entries and icons on desktops and in panels, or using keyboard shortcuts, but it is useful to know how to start applications from the terminal too. Occasions when you might want to start an application from the terminal, include:



  • When you are having a problem with an application. Often when you start an application from the terminal, messages concerning whatever errors are occurring are displayed in the terminal.
  • When you want to start an application with root permissions. For example if you want to use a file manager to move a file in a directory that requires root permissions. Some applications need to be started with root permission, in order to function.
  • When an application has no menu entry or icon, and can only be started with a command.

Table of Contents


  • How to start applications in the terminal with normal user permissions.
  • How to start applications in the terminal with root permissions.
  • How to start applications from the terminal as background processes.

Instructions


  • Starting applications with normal user permissions.

    Simply type the name of the application into the terminal, and press enter. The names of most applications are obvious. For example for Firefox, it's
    firefox
    The names of some applications are not so immediately obvious. If you get a "command not found" error when you type what you think is the name of an application into a terminal, then to find its actual name try typing the word again, but preface it with apropos. For example:

    al@my_desktop_pc:~$ chromium
    
    chromium: command not found
    
    al@my_desktop_pc:~$ apropos chromium
    
    chromium-browser (1) - the web browser from Google
    
    al@my_desktop_pc:~$
  • Starting applications with root permissions

    For security reasons, do not start applications with root permissions unless it is necessary to do so.

    To start a command line application from the terminal with root permissions, preface the name of the application with sudo then enter your password at the prompt. For example to open nano text editor with root permissions, type:
    sudo nano
    For security reasons the terminal doesn't display any feedback when you type your password, but just type it anyway then press enter.

    To start GUI applications from the terminal with root permissions, sudo must not be used. Using sudo to start GUI applications has the potential to change file ownership permissions. On most desktops the command used in place of sudo to start GUI applications, is gksudo. For example to start Nautilus from the terminal with root permissions, type:
    gksudo nautilus

    On KDE, it's kdesudo. For example to start Dolphin on KDE with root permissions, type:

    kdesudo dolphin
  • Starting applications as background processes.

    Some applications are automatically forked to the background when they are started from the terminal, but most are run in the terminal. This means that closing the terminal would kill the process, closing the application. To start an application as a background process, so that you can close the terminal without killing the process and so leave the application running, append the name of the application with &.

    For example to start the default Conky as a background process, type:
    conky &

    If the terminal doesn't return to the command prompt after starting an application as a background process, press Ctrl + C on your keyboard.


Edited by computerxpds, 11 April 2015 - 07:19 PM.


BC AdBot (Login to Remove)

 


#2 Al1000

Al1000
  • Topic Starter

  • Global Moderator
  • 7,969 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Scotland
  • Local time:09:44 PM

Posted 12 April 2015 - 12:36 PM

The terminal can also be used to start applications in non-default ways, and to find information on applications, by appending the command (the name of the application) with options. To find the list of available options and brief descriptions of them for any application, append the command with the option --help (or -h). For example to list the available options for Firefox, type:
 

firefox --help

To use any of the listed options, just use them in the same way as the --help option is used above. For example to use the "safe mode" option which disables extensions and themes, start Firefox by typing:
 

firefox --safe-mode


#3 Al1000

Al1000
  • Topic Starter

  • Global Moderator
  • 7,969 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Scotland
  • Local time:09:44 PM

Posted 22 August 2015 - 04:30 AM

Please see this thread for discussion pertaining to this topic:

http://www.bleepingcomputer.com/forums/t/587412/starting-applicatiins-using-sudo-versus-using-root/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users