Linux_ directory structure


Common catalog:
01. Windows
  C: \ Windows
  D: \ Program File
02. Linux
  / etc / sysconfig
  / usr / local
directory features 1. / is the culmination of all directory   2. the directory structure like an upside down tree   3. Directory and partition is not associated   4. / directory may be different corresponding to different partitions or disk   5. All the directories are organized according to certain categories named regular and   6. linux mount is not in the device can not see to the entrance of the prison-like with no windows, if you want the device to be accessed,   it is necessary to give the entrance the entrance is a device mount point, the mount point is to show the essence of a directory! Initial loading directory:   01. Information defining mount optical devices -> / CD / CDROM   photo complete the mount operation apparatus   Mount / On Dec / CDROM / mnt   03. mount detection results:  DF -H   04. Mounting completion of uninstall  umount / mnt directory structure development ls -ld look at a directory information   01 first disk: used to store system programs /   02 second disk: store the user's own program / usr   03 third disks: category management for user / home
  
















Common catalog:


Standard: FHS directory hierarchy [standards]

Important subdirectories:

1> NIC configuration file: / etc / sysconfig / network-
scripts / ifcfg-eth0   role Description:
  1. Configure the card to view information
  - ip address Show
  - nmtui
2. Network service process loading file
  - systemctl restart Network
  - ifdown && ifup
  Troubleshooting:
  1. The gateway IP address is smooth
  2. Verify the NIC is configured correctly
    - VI / etc / sysconfig / network-scripts / the ifcfg-eth0
  3. confirm network management services close
    -systemctl STOP NetworkManager
    -systemctl disable NetworkManager
  4. confirm virtual network editor configuration
  5. Verify that the virtual software services open
  6. Verify that the virtual network adapter configuration


2> the DNS configuration file /etc/resolv.conf
  - file information
  [root @ localhost /] # CAT /etc/resolv.conf
  # Generated by NetworkManager
  localdomain ZHQ Search
  nameserver 10.0.0.254
  - effect described for DNS resolution setting address [NIC setting configuration file is superior] 3> Host File Name:   Centos7: / etc / hostname   [the root @ localhost /] # CAT / etc / hostname   ZHQ Centos6: / etc / sysconfig / Network [Function Description]:   configure the host name, permanent [configuration name]   to view the current host name: hostname modify the current host name information   - temporarily modify: hostname zhangsan - permanent changes: vi / etc / hostname   hostnamectl the sET-hostname zhangsan   [ie temporary modifications well host name, host name and also modify the configuration file] 4> parse map file / etc / hosts   role Description: used to set the DNS domain name and IP address correspondence   [root @ zhq ~] CAT # / etc / the hosts   127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
  






















  ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

5> / etc / fstab file to mount the disk] [
  Role Description: implements the specified device files, boot automatically mount

6> boot script /etc/rc.local loading
  effect Describe: After the system starts, reads the commands in the file, thereby achieving some operating system starts to run automatically with
  use: chmod + x /etc/rc.d/rc. local
  [Centos7 need to do this in order to use this file]
7> start level file
  Centos6 / etc / inittab

  Centos7 /usr/lib/systemd/system/runlevel*.target
  [root @ ZHQ ~] # LL / usr / lib /systemd/system/runlevel5.target
  . On Oct 16 lrwxrwxrwx the root 12 is the root. 1 /usr/lib/systemd/system/runlevel5.target 09:10 -> graphical.target

  【查看】
  Centos6 cat /etc/inittab ==> runlevel
  Centos7 systemctl get-default
  [root@zhq ~]# systemctl get-default   
  multi-user.target
  【设置】
  Centos6 vim /etc/inittab ===> init 运行级别数值
  Centos7 systemctl set-default xxx
  设置启动系统启动目标
  【Centos6的7种运行级别-runlevel】
  0 关机 halt(DO NOT set initdefault to this)
  1 单用户模式 Single usr mode
  2 多用户模式 Multiuser, without NFS(The same as 3,if you do have networking)
  没有NFS(类似级别3,如果你不需要网络时)
  3 完全多用户模式 Full multiuser mode
  4 未使用 unused
  5 图形界面模式 X11
  6 重启 reboot(DO NEO set initdefault to this)

【Centos7的7种运行目标-target】
  0 关机 poweroff target
  1 单用户模式 rescure target
  2 多用户模式 multi-user target
  3 多用户模式 multi-user target
  4 多用户模式 multi-user target
  5 图形界面模式 graphical target
  6 重启 reboot target


8> 变量加载文件 /etc/profile
  【配置环境变量和别名文件】
  【国法】
  /etc/profile
  /etc/bashrc
  【家规】
  ~/.bashrc
  ~/.bash_profile
9> 登录提示文件
  /etc/motd
  【作用说明】:文件中内容,会在用户登录系统系统之【后】显示

  /etc/issue /etc/issue.net
  【作用说明】:文件中内容,会在用户登录系统系统之【前】显示
10> 编译安装目录 /usr/local
  【编译安装软件的默认目录】

  【安装软件】
  1.【rpm -ivh 软件包名称.rpm
  优:单独安装软件(半成品)
  缺:不能解决依赖关系

  2.【yum install -y 软件包名称
  优:解决软件依赖关系
  缺:不能灵活定制化
  3.【./configure && make && make install
  优: 单独定制安装软件(定制化)
  缺: 不能解决依赖关系
11> 重要日志文件
  /var/log/messages
  【软件安装运行以及系统运行异常日志文件】
  /var/log/secure
  【注:】此文件具有日志切割功能
  【系统用户登录情况日志信息】
  文件使用:
  grep 'Failed' /var/log/secure
  tail -F /var/log/secure

12> 重要信息文件
  /proc/cpuinfo
  【用于查看系统CPU信息情况文件】 命令:lscpu

  /proc/meminfo
  【用于查看系统内存信息情况文件】 命令: free -h

  /proc/loadavg
  【用于查看系统负载信息情况文件,用于衡量系统繁忙程度】 命令:w

  /proc/mounts
  【用于查看系统挂载信息情况文件】
  命令: column -t 根据文件类型进行对齐  

Guess you like

Origin www.cnblogs.com/zhanghongqi/p/11666569.html