Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My Ubuntu is 12.04.

I have just started learning Linux and Ubuntu in particular. To remember commands quicker, I'd like to decline GUI.

But there are some problems. I don't know where installed programs are to launch them.

For example, I have a pdf file. I know that there is a program to view such files. Should it be the case of GUI, I would just click on the pdf-file, and have a look that I use Document Viewer 3.4.0.

Then I would like to launch Firefox Web Browser. Even if I know it is installed, how to find the file to be launched using just CLI is a mystery to me.

Could you suggest me anything.

share|improve this question
    
how to disbale GUI: askubuntu.com/questions/196603/… –  user61928 Oct 5 '12 at 11:06
3  
My suggestion is don't decline GUI completely. Sometimes you need it. Try learning commands and using GUI simultaneously. For learning commands, you can refer to answers given below :) –  mac Oct 5 '12 at 11:17
    
This is a very open question, so it's hard to find a definitive answer. But pertaining to your problems with opening files form the CLI in particular, I would advise you to use xdg-open, a CL tool that opens files always with their predefined default applications. –  Glutanimate Oct 5 '12 at 11:23
1  
This may also interest you: askubuntu.com/questions/126268/… –  Takkat Oct 5 '12 at 11:23

4 Answers 4

As stated in other answers, usually when you install a package its executables are added to common paths, so if you know the name of the application you want to use, you just have to write its name.

If you want to know the command to execute a specific application this trick can help you:

xprop | grep WM_CLASS

this will let you click in any window you have currently open and probably get you the command needed to start that application. For example, clicking in a Document Viewer (pdf reader) window i get WM_CLASS(STRING) = "evince", "Evince", being evince the command used to open Document Viewer. If it don't works you can try replacing WM_CLASS with WM_COMMAND or WM_DESKTOP_FILE (this last will show the location of the .desktop file).

If you need to know which application provides the "command" you can use which

which evince
/usr/bin/evince

But sometimes the program you are installing put their executables in some uncommon location. Take for example PostgreSQL. If you install any of the versions available in the repositories their executables are placed in /usr/lib/postgresql/<version>/bin/. If you try to execute initdb (a PostgreSQL command) the system will not be able to find the command. In a situation like this you can use apt-file to search which package provides the initdb program and where it will be placed after installing the package

apt-file search initdb
<omitted results>
postgresql-9.1: /usr/lib/postgresql/9.1/bin/initdb
<omitted results>

Also you can use locate to try to find where the command you need is. Using again initdb as an example:

locate initdb
/etc/alternatives/initdb.1.gz
/usr/lib/postgresql/9.1/bin/initdb
/usr/share/man/man1/initdb.1.gz
/usr/share/postgresql/9.1/man/man1/initdb.1.gz

Hope those tips help you.

share|improve this answer

You must know the command to each application and you can just launch that application by wrirting the command in the terminal

For example to launch firefox web browser you can just write firefox in terminal

To open gedit the same or sudo gedit to save or read for a secured directory and like that

share|improve this answer

Honestly, for most of these programs it is enough to simply know their name. When installed from a repo, they tend to add themselves into your path, or a symbolic link to the applications binary is added into a folder in your path already.

Also, man is your best friend. Even better is to pipe man output into something like less. Then you can scroll up and down, line by line rather than having to go by entire pages, it can be very useful when trying to get that next line of output.

And last, but definitely not least, if you are new to linux, your package manager apt-get, is going to be your best friend. For experience you should install some programs from source, but knowing your package manager and being able to search it will be invaluable.

Hopefully this helps some.

share|improve this answer
    
"pipe man output into something like less" - can you add a simple example for us noobs? –  Torben Gundtofte-Bruun Sep 1 '13 at 20:05

Most of your executables are in /bin or /usr/bin. For example, you can find firefox in /usr/bin/firefox. Those two paths are in your $PATH, so you can choose your app with tab-completion

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.