歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux下修改/etc/profile文件

Linux下修改/etc/profile文件

日期:2017/2/28 14:00:18   编辑:Linux教程

通常情況下,/etc/profile文件是只讀的,直接用vi或gedit打開修改後是無法保存的。要修改profile,需要取得root權限,(使用gedit編輯)應該如下:

$sudo gedit /etc/profile

或者

$sudo -s

$gedit /etc/profile

這樣打開profile文件,修改後就可以保存了。

讓修改後的profile文件立即生效的方法:

法1:

$. /etc/profile

.和/etc/profile之間有一個空格

發2:

$source /etc/profile

source命令也稱為“點命令”,也就是一個點符號(.)。source命令通常用於重新執行剛修改的初始化文件,使之立即生效,而不必注銷並重新登錄。

Copyright © Linux教程網 All Rights Reserved