I've been scavenging the web recently for ways to open a file with its associated program on different OS's. In Windows it's pretty easy to do that. But I've been struggling with Linux and (ahem!) Macs. After a week of searching, I found it. Listed below are command line programs that do what I want:
Windows: cmd.exe /c start "path/file_name"
Linux::Gnome: gnome-open "file_name"
Linux::XFCE: exo-open "file_name"
MacOS: open "file_name"
I'm not sure about KDE yet. I've heard this command works for all versions of Linux:
xdg-open "file_name"
I haven't tried it out yet. Will post again, when I've done some tests of my own.
No comments:
Post a Comment