Ubuntu: How do I find the terminal command for anything?



Question:

I love creating hotkeys to open programs and menus, but sometimes I can't figure out what the command for something is. For instance, it took some Googling to find out that the system monitor is opened with gnome-system-monitor

Is there anyway to figure out the terminal command for any program or menu (such as keyboard shortcuts or display settings) in Ubuntu?


Solution:1

You're looking for apropos. Just type apropos <KEYWORD> in the Terminal where <KEYWORD> is your search string.

$ apropos monitor  dbus-monitor (1)     - debug probe to print message bus messages  gnome-system-monitor (1) - view and control processes  gvfs-monitor-dir (1) - Monitor directories for changes  gvfs-monitor-file (1) - Monitor files for changes  inotify (7)          - monitoring filesystem events  iotop (8)            - simple top-like I/O monitor  ip-monitor (8)       - state monitoring  ip-netconf (8)       - network configuration monitoring  jconsole (1)         - Java Monitoring and Management Console  jstat (1)            - Java Virtual Machine Statistics Monitoring Tool  mmcli (8)            - Control and monitor the ModemManager  perf_event_open (2)  - set up performance monitoring  perfmonctl (2)       - interface to IA-64 performance monitoring unit  rtmon (8)            - listens to and monitors RTnetlink  sa-check_spamd (1)   - spamd monitoring script for use with Nagios, etc.  smartctl (8)         - Control and Monitor Utility for SMART Disks  smartd (8)           - SMART Disk Monitoring Daemon  smartd.conf (5)      - SMART Disk Monitoring Daemon Configuration File  syndaemon (1)        - a program that monitors keyboard activity and disables the touchpad when the keyboard is being used.  xconsole (1)         - monitor system console messages with X  XF86VidModeGetMonitor (3) - Extension library for the XFree86-VidMode X extension  xgamma (1)           - Alter a monitor's gamma correction through the X server  

To get more information about one of the commands you can use man gnome-system-monitor


Solution:2

There is no "standard way" that I know of. (Which doesn't mean there isn't) Sometimes it's quite easy to find a command, sometimes it isn't. E.g. when looking at the process list, Google Chrome shows up as /opt/google/chrome/chrome, but it is required to start the browser with /usr/bin/google-chrome. So here are some methods which can help you.


When dealing with an UI application, you can run xprop | grep WM_CLASS, and then click on the window in question. This may give you some hints for the executable name, such as

WM_CLASS(STRING) = "gnome-system-monitor", "Gnome-system-monitor"  

Also, you can use the default file browser, navigate to /usr/share/applications and search for the icon of the program. Then right click it, select "Open with" and select a text editor. This launcher file will contain a line like:

Exec=/usr/bin/gnome-system-monitor  

If you happen to know the name of the package the program was shipped with, you can use dpkg to look up the files shipped with this package using the -L switch. Also grepping for terms like "bin" can be of help:

$ dpkg -L gnome-system-monitor | grep bin  /usr/bin  /usr/bin/gnome-system-monitor  


Solution:3

I also found out that you can look programs up in the repositories to find the terminal command.

gnome system monitor in the repositories

The text after "version" before the first space is the terminal command for this program.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »