Linux: Shell Commands for GUI Apps

, , …,

What's the command equivalent to double clicking?

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.)

What's the Linux command to put file in trash?

You can do gvfs-trash file path.

More detail at Linux: Where is the Trash Location

How to find the command name of a window?

In terminal, type xprop, then click the window, 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, ⁖ {gnome, kde, xfce, unity, setting, viewer, …}.

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

What's the command to put machine to sleep?

sudo pm-suspend or sudo pm-hibernate.

for differences, see: Linux: Put Machine to Sleep by Command Line.

What's the command to associate file with app in GUI?

Linux: Set Default Terminal, File Manager, Image Viewer

How to launch GUI app from terminal?

If the name is “xyz”, do xyz &

Linux: How to Sync X11 Primary Selection & Clipboard?

Linux: How to Sync X11 Primary Selection & Clipboard?

What's some Common Linux GUI Apps?

Linux: GUI Apps Command Names

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

blog comments powered by Disqus