gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 11:24:56 25 4
gpt4 key购买 nike

什么是大多数或所有 Linux 上可用的“打开”命令?

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

打开。

并且该文件夹显示在 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-open 但我不确定那是特定于发行版还是仅针对 gnome/kde。 (我不是 Linux 用户)

最佳答案

xdg-utils 来自 freedesktop.org。 freedesktop.org 项目旨在提高 Linux 上可用的各种不同桌面环境之间的互操作性。因此,它与您在 Linux 上执行此操作的可靠方法一样接近。

关于linux - 在桌面上显示当前目录的常用 Linux 命令是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4089696/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com