How can I open elementary apps from the ? Particularly Code and Files. I already found /usr/bin/io.elementary.files and /usr/bin/io.elementary.code, build they are not really convenient. Also, the latter doesn't detach from the terminal, so whenever the terminal window is closed, Code does the same.

Of course I can create an alias in the .bashrc file (which I did), but maybe there is a better way?


Seems like the best route for files is adding the following line to the .bashrc:

alias files='/usr/bin/io.elementary.files'

So opening a dir from the terminal would be:

files /path/to/dir

For code, there still is the issue of detaching.

4 Answers 4


Besides writing io.elementary.code or creating an alias there isn't any way to open a app from the command line.


I find that I don't want to open apps specifically from the command line, I just want to open a document and have whatever app is needed open it.

xdg-open to the rescue!

So xdg-open ~/mypdf.pdf & will automatically open my pdf document in Document Viewer. I need the & to put the terminal command into the background.

Beware - you might end up with lots of GTK css warnings with some apps, most of which can be ignored.

  • In some cases it's useful to open a file or dir in Code from the command line. Just like Sublime Text allows to.
    – wout
    Commented Nov 4, 2018 at 18:54

try "pantheon-files" on terminal to open the file manager.

  • It should be io.elementary.files. So io.elementary.files /path/to/dir.
    – wout
    Commented Nov 4, 2018 at 18:45

I don't really understand why you want to change a command, but if you want, using an alias is the way

Now, about detaching a process from a terminal, if you add & to the end it will detach and then you can close the terminal if you want/need and the process will continue running.

  • There's also a little app called 'Alias' in the store, that's basically an alias GUI, if you don't want to use the terminal.
    – Telmo
    Commented Nov 4, 2018 at 23:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.