Note: System CentOS release 6.9 (Final)
The table of contents summarized below is for reference only and is not guaranteed to be completely correct. If you have any questions, please let me know and let us learn together. Thank you!
/ System root directory, which stores system-related programs /bin The directory where the binary files of the command are stored binary /boot The file directory required by the Linux kernel and system boot program /home The home directory of ordinary users, storing user data /root root user's home directory /lib
/lib64
library library library file
lib64 system is a 64-bit library file
lost+found Disk or file system corruption Power outage Temporary file location (lost and found) / mnt temporary mount point /opt In some systems, it is used to store programs developed by third-party manufacturers, so it is named option, which means "optional" /sbin super binary super command, only root user can use /selinux SELinux and its configuration file storage location /sys virtual directory memory information /tmp Temporary file storage location
usr
/usr Store programs developed by unix system vendors /usr/local Store programs installed by users themselves. Generally, the default path when compiling software, the default path for yum or rpm package installation is generally not here /usr/src source code /usr/bin Executable program /usr/share Data files and help
dev
/dev Device directory, Device device CD-ROM hard disk
# ls /dev/sd* # hard disk
/dev/null black hole
where
/where variable frequently changed files, system logs
Changed directories, usually log files, cache directories
/ var / log / message System default log file / var / log / secure The log file that records the user's login system information, which is automatically rotated on a weekly basis, depends on the rsyslog service to be enabled (whether the login is successful from where and when) /var/spool/cron/root Timed task file for root user /var/spool/clientmqueue mail temporary directory
proc
/proc The content of the virtual directory directory is the information in memory (kernel process software) /proc/meminfo 内存信息 # cat /proc/meminfo # free -h /proc/cpuinfo 查看CPU信息 # cat /proc/cpuinfo # lscpu /proc/loadavg 根据过去一段时间内CPU和io的状态得出的负载状态,与uptime命令有关,系统的负载(即系统的繁忙程度)
# 繁忙程度 系统的负载接近系统CPU的核心数
最近1分钟 最近5分钟 最近15分钟 平均的负载
# cat /proc/loadavg
/proc/interrupts 查看中断文件 /proc/mounts 系统中使用的所有挂载
# cat /proc/mounts
# findmnt
# df -h
etc
/etc
系统配置及服务配置文件、启动命令的目录,二进制软件安装包(yum,rpm)的配置文件默认路径
/etc/fstab
开机自动挂载磁盘、设备
# cat /etc/fstab
第1列 表示设备/分区 第2列 表示入口/目录/挂载点
fstab一旦配置错误,会导致服务无法启动
# blkid # 命令行实用程序来定位/打印块设备属性
/etc/inittab
获取系统运行级别,如:3 文本模式或字符模式
/etc/issue
预登陆信息,记录用户登录前显示的系统版本等信息,建议修改
/etc/motd
登陆后提示信息,建议修改该文件信息,给用户提示信息
/etc/profile
全局环境变量 别名
/etc/bashrc
别名
~/.bash_profile
普通用户的环境变量
~/.bashrc
普通用户的环境变量
/etc/resolv.conf
DNS配置文件
/etc/rc.local
开机自启动脚本,指向/etc/rc.d/rc.local
chkconfig常用来管理yum/rpm安装的程序的服务的开机自启动
自己开发的程序,习惯把启动命令放入/etc/rc.lcal,实现开机启动,Linux开机时会把/etc/rc.local里的内容执行一遍
/etc/init.d/
服务启动命令存放的目录 yum rpm默认安装路径
# /etc/init.d/服务名 start # 开启服务
/etc/sysconfig/network-scripts/ifcfg-eth0
网卡配置文件
/etc/hosts
设定用户ip与域名的对应解析表
/etc/sysconfig/network
可以修改主机名及网卡启动,网关等配置
/etc/exports
设定NFS网络文件系统用的配置文件
/etc/profile.d/
加载系统登录程序一个目录,目录或文件独立执行
以文件的形式存在(*.sh为扩展名),但要可执行
# cat /etc/profile.d/xxx.sh
/etc/redhat-release
包括一行声明RedHat版本号和名称的信息
/etc/group
设定用户的组名与相关信息
/etc/passwd
账号信息文件
/etc/shadow
密码信息文件
/etc/sysctl.conf
内核优化,内核配置
注:此博客仅供参考,读者可以根据自己的理解进行学习Linux目录相关内容