3

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 ?

dessert
  • 39,982

1 Answers1

3

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.

See:

pLumo
  • 26,947