Linux系统重要的子目录

更多目录知识  http://blog.51cto.com/yangrong/1288072

/etc/fstab  

机自动挂载分区/磁盘,规定哪个分区/设备,挂载到哪里

 1 [root@oldboy ~]# cat /etc/fstab
 2 
 3 #
 4 # /etc/fstab
 5 # Created by anaconda on Sun Aug 12 17:26:53 2018
 6 #
 7 # Accessible filesystems, by reference, are maintained under '/dev/disk'
 8 # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
 9 #
10 UUID=c9b74b1a-41cd-4260-9444-6245ab833dd9 /                       ext4    defaults        1 1
11 UUID=8880df83-5bf8-40db-bf6f-bf878b7a7e2e /boot                   ext4    defaults        1 2
12 UUID=3144b92b-c079-4239-9a91-84111d2f1ac1 swap                    swap    defaults        0 0
13 tmpfs //要挂载设备       /dev/shm //挂载点        tmpfs//文件系统类型defaults//挂在选项0//是否备份0//是否做开机自检查
14 devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
15 sysfs                   /sys                    sysfs   defaults        0 0
16 proc                    /proc                   proc    defaults        0 0

/etc/resolv.conf

DNS临时配置文件

 1 [root@oldboy ~]#  cat /etc/resolv.conf 
 2 ; generated by /sbin/dhclient-script
 3 search localdomain
 4 nameserver 192.168.182.2
 5 [root@oldboy ~]# vi /etc/resolv.conf 
 6 ; generated by /sbin/dhclient-script
 7 search localdomain
 8 nameserver 192.168.182.2
 9 nameserver 8.8.8.8
10 ~                                                                               
11 ~                                                                                                                                                           
12 ~                                                                               
13 ~                                                                               
14 "/etc/resolv.conf" 4L, 100C written
15 [root@oldboy ~]#  cat /etc/resolv.conf 
16 ; generated by /sbin/dhclient-script
17 search localdomain
18 nameserver 192.168.182.2
19 nameserver 8.8.8.8

 /etc/hosts

主机名解析文件:

  hosts文件里存放ip地址与域名的对应关系

作用:

  • 开发,产品,测试等人员使用,用于通过正式域名测试产品
  • 服务器之间的调用可以用域名(内部的DNS),方便迁移
[root@oldboy ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

 /etc/sysconfig/nework

[root@study ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=study  //主机名

修改主机名

  • vim  /etc/sysconfig/network
  • sed -i  's#HOSTNAME=study#HOSTNAME=centos#g'  /etc/sysconfig/network

/etc/rc.local

开机自启动程序命令存放的文件(chkconfig常用来管理yum/rmp安装的程序服务的自启动)

/etc/inittab

运行级别配置文件

/etc/issue

登陆提示配置文件

[root@study ~]# cat /etc/issue
CentOS release 6.7 (Final)
Kernel \r on an \m

/var/log/messages

系统信息日志文件

转载于:https://www.cnblogs.com/liuyuanq/p/9695791.html

你可能感兴趣的:(Linux系统重要的子目录)