We know that for the operating system, such as where is the default log? Where are the disk mount files? Where is the server management directory? It is necessary for us to understand these commonly used files and directories, or even write them down, so that we can troubleshoot problems and maintain the operating system. This article introduces the CentOS7 files and directories commonly used in my work.
Commonly used files
/var/log/messages 系统默认日志
/var/log/secure 系统安全日志或用户的登录情况
/etc/hosts IP地址与域名的对应关系
/etc/fstab 磁盘挂载开机自动挂载
/etc/rc.local 开机自启动配置
/etc/sysconfig/network-scripts/ifcfg-eth0 网卡配置文件
/etc/resolv.conf DNS配置文件
/etc/shells 系统里安装的shell
/etc/ssh/sshd_config SSH Server配置文件
/etc/selinux/config SELinux配置文件
/etc/yum.conf yum配置文件
/etc/group 用户组文件
/etc/passwd 用户文件
/etc/profile 环境变量配置文件
/etc/sysctl.conf 内核参数配置文件
/etc/logrotate.conf logrotate配置文件
/etc/rsyslog.conf rsyslog配置文件
/etc/locale.conf 字符集配置文件
/etc/hostname 主机名配置文件
/etc/vimrc vim配置文件
Commonly used directories
/etc/init.d/ 服务启动管理目录
/usr/lib/systemd/system 服务启动管理目录
/etc/rsyslog.d/ rsyslog配置目录
/etc/sysctl.d/ 内核参数配置目录
/etc/profile.d/ 环境变量配置目录
/etc/yum.repos.d/ yum源配置目录
/etc/logrotate.d/ logrotate配置目录
Scheduled tasks related directories and files
/var/spool/cron/root root用户定时任务文件
/etc/crontab 用户定时任务配置文件
/etc/cron.deny 在该文件里的用户无权限运行定时任务
/etc/cron.daily/ 每天跑的定时任务
/etc/cron.hourly/ 每小时跑的定时任务
/etc/cron.monthly/ 每月跑的定时任务
/etc/cron.weekly/ 每周跑的定时任务
/etc/cron.d/ 放到里面的文件都是定时任务
Operating system version record file
/etc/system-release
/etc/centos-release
/etc/redhat-release
/usr/lib/os-release
/etc/os-release #这个文件在较的Linux发行版中,几乎都有