Talk about the important subdirectories of the Linux system

  • 2020-11-26 19:07:24
  • OfStack

/etc/fstab

Machine automatically mounts partition/disk. Which partition/device does it specify and where does it mount


 [root@oldboy ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sun Aug 12 17:26:53 2018
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=c9b74b1a-41cd-4260-9444-6245ab833dd9 /            ext4  defaults    1 1
UUID=8880df83-5bf8-40db-bf6f-bf878b7a7e2e /boot          ext4  defaults    1 2
UUID=3144b92b-c079-4239-9a91-84111d2f1ac1 swap          swap  defaults    0 0
tmpfs // To mount the device     /dev/shm // The mount point     tmpfs// File system type defaults// Hang in the options 0// Whether the backup 0// Whether to do boot self-check 
devpts         /dev/pts        devpts gid=5,mode=620 0 0
sysfs          /sys          sysfs  defaults    0 0
proc          /proc          proc  defaults    0 0

/etc/resolv.conf

DNS temporary configuration file


[root@oldboy ~]# cat /etc/resolv.conf 
; generated by /sbin/dhclient-script
search localdomain
nameserver 192.168.182.2
[root@oldboy ~]# vi /etc/resolv.conf 
; generated by /sbin/dhclient-script
search localdomain
nameserver 192.168.182.2
nameserver 8.8.8.8
~                                        
~                                                                              
~                                        
~                                        
"/etc/resolv.conf" 4L, 100C written
[root@oldboy ~]# cat /etc/resolv.conf 
; generated by /sbin/dhclient-script
search localdomain
nameserver 192.168.182.2
nameserver 8.8.8.8

/etc/hosts

Hostname resolution file:

The hosts file contains the corresponding ip address and domain name

Function:

The & # 8226; Use by developers, product testers, etc., to test products through official domain names
The & # 8226; Calls between servers can be made using a domain name (internal DNS) to facilitate migration


[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  // The host name 

Modify hostname

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

/etc/rc.local

File stored by boot bootup program command (chkconfig is commonly used to manage the bootup of yum/rmp installed program services)

/etc/inittab

Run level profiles

/etc/issue

Log in to the prompt configuration file


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

/var/log/messages

System information log file

PS: Take a look at the Linux subdirectory below

lost+found stores files that have been repaired or damaged
misc Miscellaneous equipment
net command line command
Image of proc for all running processes
tmp temporary files that disappear each time you reboot
var extracts files or temporarily generated files and directories that need to be changed during the operation of the usr directory, thus making the usr directory mounted read-only.
boot
The kernel and the files needed to load the kernel
media
It mainly interacts with SessionManager to play multimedia, pause and other operations
mnt
Connect to the directory of the CD-ROM and USB devices. After loading, there will be more directories of corresponding devices in mnt
opt: Optional application installation package
Implementation of selinux to enforce access to directories
sys system replication

conclusion


Related articles: