You are not logged in.
On the Mac, you can type 'view example.doc' to have OpenOffice open it, or 'view image.png' to have the image viewer open it, etc.
Is there something similar on Linux?
(I've searched but can't find anything.)
Last edited by chrispoole (2009-05-13 11:52:19)
Offline
I think this depends greatly on what desktop environment you're running, the only one I can help with off hand is Xfce, in which case 'exo-open' I think does this.
Offline
Have a look at /usr/bin/xdg-open script. It probably provides the mechanism you need.
Last edited by bernarcher (2009-05-13 10:30:22)
To know or not to know ...
... the questions remain forever.
Offline
In case you're using zsh as your shell of choice you could also use alias -s style aliases:
alias -s doc=openoffice
alias -s cpp=gvim
Typing the filename and hitting enter should then open it in the defined application.
Offline
I think this depends greatly on what desktop environment you're running, the only one I can help with off hand is Xfce, in which case 'exo-open' I think does this.
Thanks; I'm a GNOME user.
@chimeric I do use zsh, and didn't know about that feature, thanks.
@bernarcher I'll look into that too.
Offline
gnome-open works as well.
Offline
gnome-open works as well.
Thanks, just what I was after.
Offline
Is the command really called "view"? I ask because when I used Mac OS X (10.4), it was "open", which would open the file with whatever application was associated with it. Or did that change with 10.5?
Offline
In case you're using zsh as your shell of choice you could also use alias -s style aliases:
alias -s doc=openoffice alias -s cpp=gvim
Typing the filename and hitting enter should then open it in the defined application.
Damn that's slick. I've always stuck with Bash but I might have to reconsider (unless Bash 4 has this feature).
Offline
chimeric wrote:In case you're using zsh as your shell of choice you could also use alias -s style aliases:
alias -s doc=openoffice alias -s cpp=gvim
Typing the filename and hitting enter should then open it in the defined application.
Damn that's slick. I've always stuck with Bash but I might have to reconsider (unless Bash 4 has this feature).
It does except without the "-s". :s By default, in your ~/.bashrc, it already has "alias ls='ls --color=auto'".
Last edited by Aprz (2009-05-13 20:17:59)
Offline
Is the command really called "view"? I ask because when I used Mac OS X (10.4), it was "open", which would open the file with whatever application was associated with it. Or did that change with 10.5?
You're correct. It's still 'open'. I wasn't at my Mac OS X machine at the time and couldn't remember when I asked the question.
Offline
Agent69 wrote:chimeric wrote:In case you're using zsh as your shell of choice you could also use alias -s style aliases:
alias -s doc=openoffice alias -s cpp=gvim
Typing the filename and hitting enter should then open it in the defined application.
Damn that's slick. I've always stuck with Bash but I might have to reconsider (unless Bash 4 has this feature).
It does except without the "-s". :s By default, in your ~/.bashrc, it already has "alias ls='ls --color=auto'".
Read it again. These aren't ordinary aliases. I interpret chimeric as saying that in zsh the -s option allows you to associate file extensions with commands, not simple text replacement like your example.
Offline
Read it again. These aren't ordinary aliases. I interpret chimeric as saying that in zsh the -s option allows you to associate file extensions with commands, not simple text replacement like your example.
Ah, I missed that. That is pretty sick.
Offline