1.1 Linux directory structuregeneral structure and characteristics of 1.1.1 directory
1. Everything starts with "root" and "/" is the starting point (vertex) of all directories.
2. The directory below the Linux root is a hierarchical tree structure.
3, resembles a tree hanging upside down.
1.1.2 relative path and absolute path difference
Relative path : The path of the path, relative to the current path, with no "/" Slash at the beginning of the path, such as etc. |
Absolute path : the path from the root to the starting point, for example/ tmp |
1.1.3/ down directories and their respective roles
├──bin Essential Command binaries the path to the necessary binary commands (all users)
├──boot Static files of the directory where the boot loader system boot program is located
├──dev Device files File
├──ETC host-specific System configuration, starting program
├──home General User Storage Directory
├──lib Essential GKFX Libraries and kernel modules shared libraries and kernel modules
├──mnt mount, point for mounting a filesystem temporarily temporary mount points
├──opt Additional Application Packages
├──proc Process and kernel information
├──root Super Admin Directory
├──sbin and management system-related commands (for administrators)
├──SRV service data provided by the system
├──tmp directory where temporary files are stored
├──usr (Unix software Resource) UNIX software resources
└──var Variable Data changes
1.2 Linux Important Files 1.2.1 nic configuration file
/etc/sysconfig/network-scripts/ifcfg-eth0
Example 1-1
[Email protected] tmp]# Cat/etc/sysconfig/network-scripts/ifcfg-eth0
Device=eth0 #网卡设备的名字, Eth0 is the first piece, Eth1 is the second block.
Hwaddr=00:0c:29:06:16:2e #mac地址. The unique identity of the network card, clone virtual confidential deleted.
Type=ethernet #以太网.
Uuid=bdbcbab2-d91b-4d80-a3aa-841b9dd311b3 #网卡UUID. Clone virtual machines deleted.
Onboot=yes #开机时 whether the NIC and the system are started together.
Nm_controlled=no #网络管理器控制, do not accept.
Bootproto=none #启动协议, DHCP (Dynamic Host Configuration Protocol), static
ipaddr=10.0.0.7 #IP地址
netmask=255.255.255.0 #子网掩码
dns2=202.106.0.20 #第二个DNS.
gateway=10.0.0.2 #网关 (Internet access)
dns1=10.0.0.2 #第一个DNS.
Userctl=no
Peerdns=yes #要不要覆盖/etc/resolv.conf files (DNS client files)
Ipv6init=no #是否支持IPV6.
Setup Configuration Network is/etc/sysconfig/network-scripts/ifcfg-eth0
1.2.2 Linux system DNS Client configuration file
/etc/resolv.conf
Example 1-2
DNS:www.oldboyedu.com---->1.1.1.1 "= = to convert the URL into an IP address,
[Email protected] tmp]# cat/etc/resolv.conf "= = view DNS
NameServer 10.0.0.2 "= = the first DNS
NameServer 202.106.0.20 "= = Second DNS
1.2.3 host name configuration file
/etc/sysconfig/network
(temporarily set host name):
[Email protected] tmp]# hostname oldgirl
[Email protected] tmp]# Logout
[[email protected] ~]# hostname changed
(permanent) Set host name:
[[Email protected] ~] #vim/etc/sysconfig/network
Networking=yes
Hostname=oldboy #主机名修改这里
Setup command to change.
1.2.4 Viewing host information:uname
Uname-n Viewing host names
Uname-r Viewing kernel information
Uname-m whether the view is 32-bit or 64-bit
UNAME-A Check all information.
Example 1-3
[Email protected] ~]# uname-n
Oldgirl
[Email protected] ~]# uname-r
2.6.32-696.el6.x86_64
[Email protected] ~]# uname-m
x86_64
[Email protected] ~]# uname-a
Linux oldgirl 2.6.32-696.el6.x86_64 #1 SMP Tue Mar 19:29:05 UTC x86_64 x86_64 x86_64 gnu/linux
1.2.5 system local DNS parsing file
/etc/hosts Internal network To resolve the domain name of the tool, is to resolve the domain name to IP, commonly used for testing, server-to-site access
1.2.6 Configuring the boot automatically mount device files
/etc/fstab
Access the device to Linux, which is inaccessible by default (prison, no windows)
To access this device, it is necessary to mount (find an entrance to the device, press a door), the device's entrance is a directory,/mnt (the entrance of the temporary device).
Example 1-4
Example: a manual mount procedure
[Email protected] ~]# ll/dev/cdrom "= = View the optical drive device.
lrwxrwxrwx. 1 root root 3 May 4 15:08/dev/cdrom-sr0
[Email protected] ~]# Cd/dev/cdrom "= = want to enter the optical drive device, but there is no entrance.
-BASH:CD:/dev/cdrom:not a directory
Mount:
[Email protected] ~]# mount/dev/cdrom/mnt "= = open a door for the optical drive device (/MNT),/mnt is called mount point.
Mount:block Device/dev/sr0 is write-protected, mounting read-only
[Email protected] ~]# ls/mnt
Centos_buildtag GPL Packages rpm-gpg-key-centos-6 rpm-gpg-key-centos-testing-6
EFI images release-notes-en-us.html rpm-gpg-key-centos-debug-6 TRANS. TBL
EULA Isolinux Repodata rpm-gpg-key-centos-security-6
1.2.7 storing files for boot program commands
/etc/rc.local
1.2.8 Setting the system run level profile
/etc/inittab
What is the runlevel?
0 |
Shutdown |
1 |
Single User |
2 |
Multi-user status without NFS |
3 |
Text interface (multi-user state) |
4 |
Reserved |
5 |
Graphical interface |
6 |
Restart |
Linux Important directories and files