I would like to open folder in default file manager an focus on specific file.

I can do it with Notilus or Nemo (for example)

notilus ~/folder/file.txt
nemo ~/folder/file.txt

but I want to use default file manager.

I can use xdg-open but

xdg-open ./folder

will open folder with defaut file explorer bu doesn't focus on file, and

xdg-open ./folder/file.txt

will open file with defaut .txt editor

how can I do it ?


This works for me having nemo as default:

gtk-launch "$(xdg-mime query default inode/directory)" ./folder/file.txt

You can create an alias for it if you like.


  • Thanks! it works with Notilus and Nemo but not with Thunar – Yukulélé Jan 15 '19 at 22:48
  • In Xubuntu? Can you try exo-open ? – pLumo Jan 16 '19 at 8:17
  • i try exo-open --launch FileManager ./folder/file.txt it open text editor if Thunar is default – Yukulélé Jan 16 '19 at 23:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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