如何编辑配置文件?

ash*_*raj 2 configuration text-editor editing

我是 Ubuntu 的初学者。谁能告诉我如何编辑配置文件?

这是在 Ubuntu 18.04 LTS 上。提前致谢。

Win*_*nix 6

配置文件通常归root. 例如:

$ ll /etc/default/grub

-rw-r--r-- 1 root root 6801 Jul 18 13:26 /etc/default/grub

 ^^ ^  ^
 || |  +-- Users can only read
 || +----- Members of the group can only read
 |+------- The owner can write
 +-------- The owner can read
Run Code Online (Sandbox Code Playgroud)

为了让用户(您自己)进行编辑,/etc/grub/default您需要使用sudo权力。所以不要使用

$ ll /etc/default/grub

-rw-r--r-- 1 root root 6801 Jul 18 13:26 /etc/default/grub

 ^^ ^  ^
 || |  +-- Users can only read
 || +----- Members of the group can only read
 |+------- The owner can write
 +-------- The owner can read
Run Code Online (Sandbox Code Playgroud)

您必须使用

gedit /etc/default/grub
Run Code Online (Sandbox Code Playgroud)

此时将提示您输入密码。

注:今日相关问题:Grub文件修改后无法保存

  • 答案取决于您要编辑的配置文件。大多数是可以使用管理员权限编辑的文本文件。有些不是。例如,Firefox 配置应该在 Firefox 内部使用 `about:config` 页面完成。 (3认同)

归档时间:

查看次数:

6084 次

最近记录:

6 年,2 月 前