O'Reilly logo

Linux® For Dummies®, 8th Edition by Richard Blum, Dee-Ann LeBlanc

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Starting Programs from the Shell

The most obvious, but perhaps not so apparent, use of the shell is to start other programs. Most utilities you use in Linux are separate and distinct executable programs. Users need a method to start these programs. In the GUI, you can associate an icon with a particular program, and the graphical environment contains the intelligence to start the program. Note that programs often require information drawn from environment variables, which are a part of the shell environment. (I discuss environment variables in more detail in the section “Working with Variables,” later in this chapter.) For this reason, the GUI often calls the intended program via the bash shell. So you see, even the GUI finds the shell a necessity — although the GUI does its best to hide this detail from users.

For example, in the GUI after you have a terminal window open, type the following command at the prompt:

 mahjongg                                                            

After a few seconds, the Mahjongg game is displayed. You can start any program at a command prompt that you can click from the GNOME menu if you know what the underlying program name is. Note that if you’re in a virtual terminal (press Alt+F1) rather than the GUI, you may see an error message. Some programs require a graphical environment in which to run, which a character-based terminal obviously doesn’t have.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required