0

I'm looking for the equivalent of this command:

xdg-open /home/file.txt

Not to open gedit, leafpad or kate, but to open a file manager, like nautilus, thunar or dolphin.

Is a such command exist ? Thanks

  • So you want it to open a file manager instead of the default program for the application when using xdg-open - why not use nautilus /home/file.txt? – Wilf Sep 4 '14 at 16:35
1

Not directly, but you can tell it to open the directory containing the file:

xdg-open $(dirname /home/file.txt)

Be warned that this may have unexpected results on occasion. After I installed links, this started opening links instead of nautilus.

  • I'm using Kubuntu and the command has opened Kate, as I would like. I will try to code with this. – Guillaume Sep 4 '14 at 17:22
  • @Guillaume It opened Kate? I thought that wasn't what you wanted. – muru Sep 4 '14 at 17:26
  • Oh sorry, I would like to say "Dolphin" !! – Guillaume Sep 4 '14 at 19:37

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.