本地的DNS
/etc/hosts windows的位置 C:\Windows\System32\drivers\etc\hosts 用于设置DNS域名与ip地址对应关系 本地做了一个解析,IP和域名,但是其他人无法通过域名访问,
/etc/fstab
/etc/rc.local 1.编辑开机自启动脚本 vim /etc/rc.local 2.设置开机自启动权限 chmod +x /etc/rc.d/rc.local 3.重启系统看结果 reboot
systemctl set-default 系统启动级别 0 关机 1 单用户模式(无法通过xshell的方式使用) 无密码改密码 2 多用户无网模式 3 完全多用户模式 4 待定 5 桌面模式 6 重启 设置系统级别: init [级别编号] 临时设置 systemctl set default [系统启动级别] 永久设置 "通过单用户模式更改密码" 1.重启 2.启动选择系统内核界面按 e 键进入单用户模式 3.移动光标Linux16就 ro 将其修改为 rw init=/sysroot/bin/sh 4.按CTRL+x进行系统重新引导 5.执行chroot /sysroot 回车 切换至sysroot系统 6.passwd root 回车 # 输入新密码 7.执行 touch /.autorelabel 8.CTRL +d/D 重启系统 # 完全多用户模式改密码 passwd root 重新改回去密码
在Linux中添加环境变量 /etc/profile /etc/bashrc ~/.bash_profile ~/.bashrc # 文件夹 /etc/profile.d/ # 增加环境变量两种方式 1.临时添加 2.永久添加(添加到文件中) # 增加环境变量的格式: export PYTHON_HOME='D:/python' vim ~ # 查看本机的关键变量 echo $PYTHON_HOME 查看某一个环境变量 printenv 查看所有的环境变量 # 读取环境变量的几种情况(顺序) 1.重启 1./etc/profile.d/ 2./etc/profile 3./etc/bashrc 4.~/.bashrc 5.~/.bash_profile # 谁在最后谁生效 2.切换用户 1./etc/profile.d 2./etc/bashrc 3.~/.bashrc # 只有当前用户生效 3.重新登录用户 # 方式一:su - [用户名] 1./etc/profile.d 2./etc/profile 3./etc/bashrc 4.~/.bashrc 5.~/.bash_profile # 方式二:ssh root@192.168.15.101 1./etc/profile.d 2./etc/profile 3./etc/bashrc 4.~/.bashrc 5.~/.bash_profile "知识储备:" # 创建用户切换用户 useradd [用户名] su [用户名]
# 登录成功之后显示的信息 /etc/motd # 登录之前显示的信息 /etc/issue
# 安装第三方软件的目录 /usr/local # 安装python3 1.下载rpm安装包 2.yum安装python yum install python3 which python3 查看安装到哪里了
/var 绝大部分日志存放在此
# 保存cup运行状态的:/proc/cupinfo lscpu # 保存内存状态的:/proc/meminfo free # 保存系统负载信息:/proc/loadavg w 0.00 :一分钟内cpu负载 0.01 :五分钟内cpu负载 0.05 :十五分钟内cpu负载 "负载:当前系统的所有进程占用cpu的时间比" # 保存系统过载信息:/proc/mounts mount umount