2010-11-03 17 views
2

什麼是在大多數或所有Linux上都可用的「open」命令?在桌面上顯示當前目錄的常用Linux命令是什麼?

例如在OS X中,我可以在shell中做

open。

和文件夾顯示在Finder(即桌面) 類似地,在Windows上,該命令是「瀏覽」。

因爲我想要一個emacs中的跨平臺命令。

(defun open-in-desktop() 
    "Open the current file in desktop. 
Works in Microsoft Windows and Mac OS X." 
    (interactive) 
    (cond 
    ((string-equal system-type "windows-nt") 
    (w32-shell-execute "explore" 
     (replace-regexp-in-string "/" "\\" default-directory t t))) 
    ((string-equal system-type "darwin") (shell-command "open .")) 
    )) 

有人建議XDG-開放的,但我不知道這只是KDE的具體的發行或GNOME /。 (我不是Linux用戶)

+0

http://stackoverflow.com/questions/41969/standard-way-to-open-a-folder-window-in-linux – 2011-06-10 02:38:57

回答

8

xdg-utils來自freedesktop.org。 freedesktop.org項目旨在提高Linux上各種不同桌面環境之間的互操作性。因此,在Linux上進行這種操作的可靠方法已經很接近了。

3

xdg-open點向用戶的首選瀏覽應用程序,所以一般工作。

相關問題