Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道如何使用 Tramp 以 root 身份使用 sudo 打开/编辑 Emacs 中的文件。我想知道是否有办法使用 sudo 运行 Emacs 命令,而无需打开 shell?
就像是:
sudo Mx 查找名称-dired
或者
Mx sudo find-name-dired
例如。
如果您的命令涉及文件系统上的某些路径,则可以像这样利用 tramp M-x find-name-dired RET /sudo::/your/path:.
M-x find-name-dired RET /sudo::/your/path