Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-25-2009, 02:53 PM   #1
Registered: Jan 2007
Posts: 33

Rep: Reputation: 15
Finding the command line to launch an application from a terminal.

Is there a way to find out the currently installed packages and the corresponding command line to launch the package from a terminal. For example, I know that I have openoffice installed but I do not know how to find the command line to launch it.
Old 09-25-2009, 03:26 PM   #2
John VV
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,181

Rep: Reputation: 2505Reputation: 2505Reputation: 2505Reputation: 2505Reputation: 2505Reputation: 2505Reputation: 2505Reputation: 2505Reputation: 2505Reputation: 2505Reputation: 2505
OO is an odd one in that a start up script launches it

but for most programs it is just the name
for example
The Gimp 2.6 is " gimp "
Firefix 3.5 is " firefox"
OO 's "word" is = " -writer %U ", or the program name -- " oowriter "
Old 09-25-2009, 03:36 PM   #3
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
If you are using ubuntu you can find installed applications by using
dpkg -l
It will produce a lot of output so you may want to redirect it to a file for browsing later
dpkg -l > /tmp/dpkg.out
You can install apt-file and then use it to list all the files in a given package
apt-file update
apt-file list <package name>
apt-file update takes a long time to run. apt-file list will list many files; application executable files are probably in /usr/bin, /usr/local/bin or somewhere under /opt.

The apropos command finds many commands but not all and you have to be inventive about the keyword. If it lists some commands related to what you are interested in you could use the type command to find their location and then list files in the same place. guessing some part of the name as in this example
c@CW8:~$ apropos office
o3read (1)           - convert files in format.
o3tohtml (1)         - convert files in format.
o3totxt (1)          - convert files in format.
update-openoffice-dicts (8) - rebuild dictionary.lst for
c@CW8:~$ type o3read
o3read is /usr/bin/o3read
c@CW8:~$ ls /usr/bin/*office*
/usr/bin/openoffice.org3  /usr/bin/openoffice.org3-printeradmin  /usr/bin/soffice
As it happens I know that soffice is the main OOo executable; on ubuntu there is a man page for it
man soffice
If you can start the application from the GUI you can use the ps command to find which command lines are being run
c@CW8:~$ ps -f -uc
c        23923     1  0 01:46 ?        00:00:00 /bin/sh /opt/openoffice.org3/program/soffice -writer file:///home/c/Desktop/CW8%20ubuntu%20software%20log.odt
c        23933 23923  3 01:46 ?        00:00:25 /opt/openoffice.org3/program/soffice.bin -writer file:///home/c/Desktop/CW8%20ubuntu%20software%20log.odt
c        24176  8067  0 01:57 ?        00:00:00 sleep 2m
c        24190 23832  0 01:58 pts/0    00:00:00 ps -f -uc
-f asks for a full listing and -uc asks for for processes belonging to user c. The PID (process ID) and PPID (parent process ID) connections are informative.
Old 09-25-2009, 04:00 PM   #4
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
I assume you can still right click the menus and launchers on kde or gnome to see where a given icon or item is pointing to, so that's a way to find the right command for a given program, however I don't use any DE myself so I am not sure
Old 09-25-2009, 04:29 PM   #5
Registered: Apr 2001
Location: chicago, IL
Distribution: debian, redhat
Posts: 280

Rep: Reputation: 30
for RPM based systems:
rpm -qa
Old 09-25-2009, 05:08 PM   #6
Registered: Jan 2007
Posts: 33

Original Poster
Rep: Reputation: 15
Thanks guys. The suggestions really helped. I now have a fair idea. I tried two methods to get the command line and both worked. That is,

Ran the application from GUI and then ran ps -f -uc command (where c is the username)

I also right clicked on the icon of the application on my desktop and looked at the properties. It also gave me the command line that launched the application.

Thank you all once again.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I resize the terminal window from the command line in the gnome terminal QuIcKSpArK Linux - Newbie 5 04-21-2012 02:04 PM
How to launch Krfb using the command line? bnj Linux - Networking 5 11-06-2009 08:08 AM
How do I launch a Java applet using the command line? jacatone Linux - Software 1 01-17-2009 11:01 PM
How do you launch Mozilla Firefox from the command line ? pppaaarrrkkk Linux - Newbie 1 10-07-2005 02:06 PM
gnome: launch application associated to a document type from command line cweiske Linux - Software 1 09-28-2004 06:47 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:30 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration