(Notes) Linux system directory

Basic directory:


/etc    | 配置文件

/var    | 存放运行时需要改变数据的文件

/usr    | 用于存放系统应用程序。安装的软件一般都在这个目录下/local

/opt    | 额外安装的可选应用程序包所放置的位置

/mnt    | 系统管理员安装临时文件系统的安装点

/home   |存放所有用户文件的根目录

/bin	|存放二进制可执行文件(ls,cat,mkdir 等)

/dev	|设备(device)缩写,所需要的装置文件

/lib	|执行档所需的函式库与核心所需的模块

/boot   |存放用于系统引导时使用的各种文件

/sbin	|重要的系统执行文件,存放二进制可执行文件,只有 root 才能访问

/root   |超级用户目录(root)

/srv    | srv可以视为service的缩写。常见的服务例如WWW, FTP等应放在这里

/tmp    | 临时文件存放区

/proc   |虚拟文件系统,存放当前内存的映射

/var Detailed

/var A directory that will gradually occupy hard disk capacity after the system is running. Because the /var directory is mainly for files that change regularly, including caches, log files, and files generated by certain software operations, including program files (lock files, run files), such as MySQL files, etc. Wait

/var/log/
This is the directory where the login files are placed. There are more important files such as /var/log/messages, /var/log/wtmp (recording the information of the login person) and so on.

/var/run/ After
some programs or services are started, their PIDs will be placed in this directory

/var/cache/
Some temporary files generated during the operation of the application itself

The /var/spool/
directory usually contains some queue data. The so-called "queue" is the data queued for use by other programs. These data are usually deleted after being used. For example, a new letter received by the system will be placed in /var/spool/mail/, but in principle, the letter will be deleted after the user accepts the letter. If the letter cannot be sent temporarily, it will be placed in /var/spool/mqueue/, and will be deleted after it is sent. If it is work schedule data (crontab), it will be placed in the /var/spool/cron/ directory

/var/mail/
is the directory where personal e-mail mailboxes are placed, but this directory is also placed in the /var/spool/mail/ directory, usually these two directories are mutually linked files.

/var/lib/
The directory where the data files that need to be used are placed during the execution of the program itself. Each software in this directory should have its own directory. For example, the MySQL database is placed in /var/lib/mysql/ and the rpm database is placed in /var/lib/rpm

/var/lock/
Some devices or file resources can only be used by one application program at a time. If two programs use the device at the same time, some error conditions may occur, so the device must be locked ( lock) to ensure that the device will only be used by a single software. For example, the recorder is burning a disc. Think about it, will two people use the same recorder to burn the disc at the same time? If two people burn at the same time, whose data is written into the film? So when the first person is burning, the recorder will be locked, and the second person will have to unlock the device (that is, the previous person has used up) before they can continue to use it.

This part is reproduced from: https://blog.csdn.net/yup1212/article/details/82152106

System settings file

/etc/firewalld/zones/public.xml    |  防火墙配置文件

/var/spool/cron     | 定时任务目录,以账号来区分每个用户自百己的执行计划

/etc/crontab        | 系统执行计划任务,需要在五个*后面指定问用户

/etc/nginx/conf.d/blockip.conf  | ip黑名单

View log

 tail -n 50 20200708.log   |  显示最后50行
 
 tail -n +1000             | 从1000行开始显示,显示1000行以后的
 head -n 1000              | 显示前面1000行

Guess you like

Origin blog.csdn.net/qq_39004843/article/details/106114512