Thursday, January 15, 2009

HowTo: Find command line name of a program?

Sometimes, we'd like to install programs that aren't really part of the Ubuntu Repositories. That's not really recommended, but we do it anyway. We would compile it from source and then execute it with a ./ or a sh . Too often than not, when we'd like to run that program again, we do so through the command line. But what if the command to run it isn't its name? For example, let's say we compiled program-name: foo. To run foo we assume that we type foo on the command line. But when we run foo we get this:


dan@ubuntu:~$ foo
bash: foo: command not found
So what do we do? There are two solutions that I've managed to come accross in Ubuntuforums:

1. If the said program is a GUI program, we can do this solution by caljohnsmith:


If the program name you are looking for is for a GUI app, one trick you can do is run the GUI app from the menus, and then in a terminal do:
Code:
xprop | grep WM_CLASS
Then click on the GUI app Window, and most of the time the "WM_CLASS" field of xprop will tell you the GUI app name that can be run in the terminal. Is that maybe what you are looking for?

2. Another is by lwsb


2.a You can use synaptic, search for the package, then click on the tab that says "installed files" Look for one that is in one of the bin directories. From the command line you can use something like
dpkg -L packagename|grep bin


2.b Use the "locate" command. For example, say you know that there is a command for tweaking linux filesystems that has the word "fox" in it, but can't remember the exact name.

locate bin/foo
 

2.c "man -k", used like "man -k foo" This will search all man pages for "keyword" and return a list of commands and short descriptions.


As usual I got this tip from Ubuntuforums.

Ubuntuforums is a great resource not only for Ubuntu specific concerns but also for General GNU/Linux concerns. It's awesome.

No comments:

Post a Comment

EventId's in Nostr - from CGPT4

The mathematical operation used to derive the event.id in your getSignedEvent function is the SHA-256 hash function, applied to a string rep...