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. Most Useful GUI Apps
  2. Set Default App
  3. Shell Commands for GUI Apps
  4. Image Viewers
  5. Music Players
  6. Move File to Trash by Command
  7. X11 Selection and Clipboard
  8. How to Switch to LXDE, Xfce
  9. LXDE Keyboard Shortcuts
  10. LXDE/Openbox, Change Keyboard Shortcuts
  11. LXDE Set Key Repeat Rate
  12. LXDE/OpenBox, Disable Mouse Scroll Wheel Hide Window
  13. Xfce Keyboard Shortcuts
  14. Xfce Good Themes
  15. xmonad Keybinding
  16. How to Restart X11
  17. Why Tiling Window Manager Sucks

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