Linux: Shell Commands for GUI Apps

, , …,

What's the command equivalent to double clicking?

xdg-open file path

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?

It depends on what desktop are you using. There's no universal way. See: https://wiki.archlinux.org/index.php/Default_applications

How to launch GUI app from terminal?

If the name is “xyz”, do xyz &

Linux: How to Sync X11 Primary Selection & Clipboard?

See: Linux: How to Sync X11 Primary Selection & Clipboard?

What's some Common Linux GUI Apps?

See: Linux: Most Useful Common GUI Apps

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

blog comments powered by Disqus