在桌面上显示当前目录的常用Linux命令是什么?

问题描述:

什么是在大多数或所有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

xdg-utils来自freedesktop.org。 freedesktop.org项目旨在提高Linux上各种不同桌面环境之间的互操作性。因此,在Linux上进行这种操作的可靠方法已经很接近了。

xdg-open点向用户的首选浏览应用程序,所以一般工作。