1、解析映射文件
/etc/hosts
C:\Windows\System32\drivers\etc\hosts
本地的DNS
192.168.15.101 www.baidu.com
2、磁盘挂载文件
3、开机加载脚本
/etc/rc.local
1、编辑开机自启动脚本
vim/etc/rc.local
echo 'hello word' >/root/index
2、设置开机自启动权限
chmod + /etc/rc.d/rc.local
4、系统启动级别
* ```bash
系统启动级别
0、关机
1、单用户模式(无法通过Xshell的方式使用)
2、多用户无网络模式
4、待定
5、桌面模式
6、重启
设置系统级别:
init[编号] 临时设置
systemctl set-default[系统启动级别]
通过单用户模式修改密码
1、重启
2、在启动选择系统内核界面, 按e键进入单用户模式
3、找到linux16开头行,删除ro,并且在ro 处添加 rw init=/sysroot/bin/sh
4、按Ctrl +x 进行系统的重新引导
5、执行chroot/sysroot
6、执行 psaawd root
7、执行 touch /.autorelabel
8、执行Ctrl +D 重启系统
```
*
5、变量加载文件
在linux中添加环境变量怎么添加呢?
文件
/etc/profile
/etc/bashrc
~/.bash_profile
~/.bash_rc
增加环境变量有两种方式
1、临时添加
2、永久添加
增加环境变量的几种情况。并且测试出使用文件的先后顺序
1、重启
/etc/profile.d--> /etc/profile --> /etc/bashrc --> ~/.bashrc --> ~/.bash_profile
2、切换用户
/etc/profile.d --> /etc/profile --> /etc/bashrc --> ~/.bashrc
知识储备:
useradd[用户名]
su[用户]
3、重新登录用户
1、su - [用户名]
/etc/profile.d --> /etc/profile --> /etc/bashrc --> ~/.bashrc --> ~/.bash_profile
2、ssh root@192.168.15.101
/etc/profile.d --> /etc/profile --> /etc/bashrc --> ~/.bashrc --> ~/.bash_profile
6、编译安装目录
#安装第三方软件的目录
/usr/local
下载rpm安装包
yum安装python:yum intall python3
7、系统日志目录
保存CPU运行状态的: /proc/cpuinfo
iscpu
保存内存的状态的: /proc/meminfo
free
保存系统负载的: /proc/loadavg
w
0.00 : 1分钟内的CPU负载
0.01 : 5分钟内的CPU负载
0.05 :15分钟内的CPU负载
负载:当前系统的的所有进程占用的时间比
保存系统挂载信息: /proc/mounts
mount
umount