Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 18th September 2008, 06:52 AM
charactermatter Offline
Registered User
 
Join Date: Mar 2004
Location: Sedro-Woolley, WA USA
Age: 48
Posts: 87
terminal command

Is there a way to tell the command to run a program by looking at something in the files? For instance, Firefox in a terminal launches firefox. That one is easy to figure out and you could get it if you didn't already know just by taking a wild guess. Some programs don't seem to be so straightforward. So, is there a way I can tell by looking at the pakage or a particular file that tells me what the command line to launch it is?
Reply With Quote
  #2  
Old 18th September 2008, 07:31 AM
ozjd's Avatar
ozjd Online
Registered User
 
Join Date: Feb 2008
Location: Sydney Australia
Age: 57
Posts: 2,228
One way is to look at the menu editor and see the command used there but the better way is to view the man page for that package.
The command is "man packagename " Most man entries will give you details on how to start the package as well as the options available.
Reply With Quote
  #3  
Old 18th September 2008, 07:37 AM
charactermatter Offline
Registered User
 
Join Date: Mar 2004
Location: Sedro-Woolley, WA USA
Age: 48
Posts: 87
Thanks for a simple solution. I suppose I should have thought about reading the instructions, but that gene is recessive...
Reply With Quote
  #4  
Old 18th September 2008, 03:50 PM
vallimar Offline
Registered User
 
Join Date: Jul 2008
Posts: 811
Nearly all *nix programs support "-h" or "--help" to provide a brief (sometimes not) usage summary and options listing.

Last edited by vallimar; 18th September 2008 at 03:51 PM. Reason: better quoting
Reply With Quote
  #5  
Old 18th September 2008, 04:04 PM
Mariano Suárez-
Guest
 
Posts: n/a
Quote:
Originally Posted by vallimar
Nearly all *nix programs support "-h" or "--help" to provide a brief (sometimes not) usage summary and options listing.
He's asking (IIUC) how to find the name of the executable. The --help option is of little help there ;-)


As for the OP's question: the only way to know what executables are installed by a package is to look in the package file list. For example, say you want to know what executable files are installed by the firefox package. One way to get a list of everything installed by the package is:
Code:
rpm -q --list firefox
That will produce a long list (319 files), but very very few of them are actually executable files. One way to filter out the support files is to look in that long list for files which are put in the /usr/bin directory, where essentiall all executables are put. You can do that by running
Code:
rpm -q --list firefox | grep ^/usr/bin
Now the list is much shorter: it has exactly one item.

Be aware, though, that some of the Fedora packages install lots of executables. An example is the coreutils package, which provides 64, as you can see from running:
Code:
rpm -q --list coreutils| grep ^/usr/bin | wc -l
Reply With Quote
  #6  
Old 18th September 2008, 04:26 PM
PabloTwo's Avatar
PabloTwo Online
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,128
Quote:
Originally Posted by Mariano Suárez-
Code:
rpm -q --list coreutils| grep ^/usr/bin | wc -l
Good advice. But that example misses the two executables that land in /sbin/ from the coreutils package, and fails to print the list itself. To catch all the executables, regardless of which "bin" they are in, better to use, as an example:
Code:
rpm -ql coreutils | grep bin/
The " | wc -l " only prints a Word Count of the resulting list and the list is not seen.
Reply With Quote
  #7  
Old 18th September 2008, 05:30 PM
Mariano Suárez-
Guest
 
Posts: n/a
The command only prints the number because, as I said, the command was used to see how many such executables there are. In other words, the command does not print the list itself because it was not intended to.

OTOH, I chose to ignore what's put in other places simply because those other executables are not intended to be run by the user in normal situations---that is why the sbin directories do not show up in default PATHs, for example; as another example, some packages but executables in /usr/libexec, too, but it makes little sense to include them...

I did miss the ones in /bin, though (regular, non-system, packages should not put anything there, so it is no big loss for user packages, like firefox's)
Reply With Quote
  #8  
Old 19th September 2008, 07:33 AM
charactermatter Offline
Registered User
 
Join Date: Mar 2004
Location: Sedro-Woolley, WA USA
Age: 48
Posts: 87
Thank you all for your posts. I like reading tricks and tips from the pros.
Reply With Quote
Reply

Tags
command, terminal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
terminal command problem "chkconfig: command not found" Omni-Tom Using Fedora 3 19th July 2008 03:29 AM
Terminal Command ? simonsez Using Fedora 6 3rd February 2006 04:15 AM
Terminal Command? simonsez Using Fedora 10 27th August 2005 05:45 AM
Terminal command help DealerMan Using Fedora 2 19th August 2005 05:51 AM
Terminal Command ? simonsez Servers & Networking 3 15th August 2005 08:35 AM


Current GMT-time: 23:04 (Saturday, 25-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat