Open file with default application from terminal in Ubuntu

It’s more efficient to open files with default application from terminal if most of your work is in terminal,so that you needn’t to open a file browser like nautilus then open the file.You need to use different file-opener based on what Desktop Environment application you are using.

Open file with Gnome’s (Unity) default application

gnome-open filename


gvfs-open filename


Open file with KDE’s default application

kde-open filename


Open file with XFCE’s default application

exo-open filename

Open file with X’s default application

xdg-open filename

Tip:Both Gnome KDE Xfce are desktop environment  which is installed on top of X Window System.So xdg-open simply passes the arguments to that desktop environment’s file-opener application (gvfs-open, kde-open, or exo-open, respectively), which means that the associations are left up to the desktop environment.

Leave a Reply

Your email address will not be published. Required fields are marked *