㈠ linux中/etc与/var目录,各是什么意思这两个目录下的文件有什么特点

意思:linux中/etc是配置文件的目录,/var是储存各种变化的文件。

特点:

/etc的特点:包含了广泛的系统配置文件,这些配置文件几乎包含了系统配置的方方面面,是一个底层的重要项目,通常添加一些次等重要的零碎事物。

/var的特点:包含系统运行时要改变的数据。其中包括每个系统是特定的,即不能够与其他计算机共享的目录。

(1)操作系统目录扩展阅读:

linux文件目录分析/etc目录

在linux下修改系统配置时就会在/etc这个目录下修改配置文件,可见这个目录是系统的配置文件目录。

etc/profile

系统全局环境变量设置,里面可以添加对所有用户有效的环境变量,系统配置等。

$ cat profile

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))

# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "$PS1" ]; then

if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then

# The file bash.bashrc already sets the default PS1.

# PS1='h:w$ '

if [ -f /etc/bash.bashrc ]; then

. /etc/bash.bashrc

fi

else

if [ "`id -u`" -eq 0 ]; then

PS1='# '

else

PS1='$ '

fi

fi

fi

if [ -d /etc/profile.d ]; then

for i in /etc/profile.d/*.sh; do

if [ -r $i ]; then

. $i

fi

done

unset i

fi