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

  1. How to Switch to LXDE, Xfce
  2. LXDE Keyboard Shortcuts
  3. LXDE/Openbox, Change Keyboard Shortcuts
  4. LXDE Set Key Repeat Rate
  5. LXDE/OpenBox, Disable Mouse Scroll Wheel Hide Window
  6. Xfce Keyboard Shortcuts
  7. Xfce Good Themes
  8. xmonad Keybinding
  9. Why Tiling Window Manager Sucks
  10. Set Default App
  11. Shell Commands for GUI Apps
  12. Image Viewers
  13. Move File to Trash by Command

If you have a question, put $5 at patreon and message me.