Linux: Shell Commands for GUI Apps

By Xah Lee. Date: . Last updated: .

Command Line for Double Click

xdg-open file_path

# open current dir
xdg-open .

In gnome, you can use gvfs-open file_path. (Note: there's gnome-open, but is deprecated.)

Command Line for Move to Trash

[see Linux: Move File to Trash by Command]

Find Command Name of App

  1. In terminal, type xprop
  2. then click the window
  3. then read the line “WM_CLASS” and “_NET_WM_PID”.

Or, launch the app by mouse. Then, in terminal type ps -ef | grep string, where string is what you think the name contains, for example, {gnome, kde, xfce, unity, setting, viewer, …}.

Or, type top first, then launch the app, and watch it appear in top.

Command to Put Machine to Sleep

[see Linux: Command to Shutdown / Restart / Sleep]

Command to Set Default App

[see Linux: Set Default App]

launch GUI app from terminal?

xyz & → launch GUI app named “xyz”.


setsid xyz

[see Linux: GUI Apps Command Names]

[see Linux: Job Control]

Linux: Sync X11 Primary Selection and Clipboard

Linux: Sync X11 Primary Selection and Clipboard

thanks to amirhoshangi, Manuel Lara, Leonardo Torres, Yanko Simeonoff.

Linux Desktop Topic

  1. Linux: How to Switch to LXDE, Xfce
  2. Linux: LXDE Keyboard Shortcuts
  3. Linux: LXDE/Openbox, Change Keyboard Shortcuts
  4. Linux: LXDE Set Key Repeat Rate
  5. Linux: LXDE/OpenBox, Disable Mouse Scroll Wheel Hide Window
  6. Linux: Xfce Keyboard Shortcuts
  7. Linux: Xfce Good Themes
  8. Linux: xmonad Keybinding
  9. Why Tiling Window Manager Sucks (xmonad, ratpoison, dwm, …)

  1. Linux: Set Default App
  2. Linux: Shell Commands for GUI Apps
  3. Linux: Image Viewers
  4. Linux: Move File to Trash by Command