linux 下重要的目录及配置文件1、/etc/inittab   配置linux启动级别#   0 - halt (Do NOT set initdefault to this)#   1 - Single user mode#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)#   3 - Full multiuser mode#   4 - unused#   5 - X11#   6 - reboot (Do NOT set initdefault to this)2、/etc/sysconfig/i18n系统默认语言设置3、/etc/sysconfig/init 配置ttyCentOS5之前是直接在/etc/inittab文件中注释多余tty就可以了,但是6.3发生了改变,在# What ttys should gettys be started on?ACTIVE_CONSOLES=/dev/tty[1-6]# Set to '/sbin/sulogin' to prompt for password on single-user mode# Set to '/sbin/sushell' otherwiseSINGLE=/sbin/sushell /etc/init/start-ttys.conf# This service starts the configured number of gettys.start on stopped rc RUNLEVEL=[2345]env ACTIVE_CONSOLES=/dev/tty[1-6]4、/etc/issue 系统启动欢迎界面配置文件,可查看系统发行版本5、/boot 系统启动引导程序及配置,系统内核存放位置vmlinuz6、/lib/modules/2.6.32-279.el6.x86_64/kernel 系统内核模块存放的位置7、/proc 内存中的数据,如内核、程序等8、/etc/rsyslog.conf 系统日志配置文件,centos6 之前为/etc/syslog.conf9、.bash_history 存放执行过的命令10、/etc/shell 系统支持的shell11、/etc/init.d 系统服务启动脚本所在位置12、/etc/sysconfig/* 各服务初始化环境配置文件13、/etc/ld.so.conf.d 配置需要加载到内存中的模块14、/etc/ld.so.conf 指定哪些加载模块文件被加载15、/etc/sysconfig/network-scripts 网络配置文件所在位置16、/etc/sysconfig/network 指定主机名17、/etc/host 主机ip与域名解析文件18、/etc/passwd 系统账户密码文件19、/etc/shadow 系统账户密码加密文件20、/etc/rc.sysinit 系统开启环境初始化脚本rc0.d 系统关机需要执行的服务脚本所在位置rc1.d 单用户模式需要启动的服务脚本所在位置rc2.d 多用户但无网络模式启动的服务脚本所在位置rc3.d 多用户网络开启的服务脚本所在的位置rc4.d 保留rc5.d 图形界面开启的服务脚本所在位置rc6.d 重启系统的服务脚本所在位置rc.local 开机执行自己制定需要开启的服务或需要执行的命令21、/etc/profile 系统环境变量配置文件,不可轻动22、/etc/cron.deny /etc/cron.allow 控制那些用户可以使用crontab来执行计划任务23、/etc/at.deny /etc/at.allow 与22同是控制at的使用账户24、/proc目录/proc/cpuinfo cpu 信息/proc/filesystems 目前系统已经加载的文件系统/proc/meminfo 内存使用信息/proc/modules 目前系统已加载的内核模块/proc/pci pci总线上每个设备的详细情况 可用lspci 查看25、/etc/selinux/conf 是否开启selinux,需重启vi /etc/selinux/config  # This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:#     enforcing - SELinux security policy is enforced.#     permissive - SELinux prints warnings instead of enforcing.#     disabled - No SELinux policy is loaded.SELINUX=disabledgetenforce 查看当前是否开启了selinxusetenforce [1|0]0 转成permissive 模式,当因selinux 导致程序无法执行时可设为0,则只报警告26、/etc/services 查看服务所对应的端口27、/var/log/cron 此日志文件记录系统计划任务执行状态/var/log/dmesg 记录开机内核检测过程产生的信息/var/log/lastlog 所有最近一次登陆系统信息/var/log/messages 记录系统发生错误信息/var/log/secure 记录系统认证信息/var/log/wtmp 所有账户的历史登陆信息 使用命令lastlog28、/etc/rsyslog.conf 系统日志配置文件,用来配置系统中各种服务产生什么级别的日志,日志写到哪些位置,系统日志服务syslogd29、 /lib/modules/`uname -r`/kernel  内核模块所在的目录arch:与硬件平台相关crypto:内核所支持的加密技术drivers:硬件的驱动程序fs:内核支持的文件系统lib:函数库net:与网络相关,及防火墙sound:与声音相关/etc/modules/`uname -r`/modules.dep 这个文件记录了内核支持的模块的各项依赖性此文件由depmod不带任何参数生成30、内核源码所在位置/usr/src31、/etc/sysconfig/modules 用户自定义模块所在位置32、/usr/include 系统头文件位置/usr/local/include 用户软件头文件位置头文件以 .h 为后缀一句话,头文件事实上只是把一些常用的命令集成在里面,你要用到哪方面的命令就载入哪个头文件就可以了,系统会自动搜索这两个目录33、/lib /lib64 系统函数库所在位置,函数库包括动态函数.so 静态函数 .a/usr/local/lib/usr/local/lib64 用户函数库所在位置34、全局变量配置文件位置/etc/profile  /etc/profile.d/* /etc/bashrc交互式读取顺序/etc/profile -- /etc/profile.d/* --/.bash_profile --/.bashrc -- /etc/bashrc非交互式读取配置文件顺序`/.bashrc--/etc/bashrc--/etc/profile.d/*profile 类设定环境变量设定启动操作根据范围需要设定在那个文件 bashrc 类设定本地变量设定命令别名别名的声明与撤销alias ALISA=COMMANDunalias ALIASalias cdnet=“cd /etc/sysconfig/network-scripts/”使用原来的命令\rm a35、/etc/logrotate.conf  日志轮替程序配置文件36、/etc/rsyslog.conf	 系统日志定义配置文件rsyslog 的日志文件被vi编辑过就无法再写入日志,需要重启rsyslog 服务37、用户自定义模块加载配置文件:/etc/sysconfig/modules/*.modules  注意文件名必须以.modules 结尾38、系统内核模块加载配置文件/etc/modprobe.conf系统内核模块依赖关系文件/lib/modules/$(uname -r)/modules.dep使用命令depmod 创建此文件

莫把容易得,便做等闲看,积累了很长时间