系统命令
查看系统版本 方式一 cat /etc/issue 方式二 sudo lsb_release -a
查看命令的具体位置 whereis 命令 例子: whereis ifconfig
系统启动级别 /etc/inittab 3 为完整多用户模式 5 窗口模式
centos7 关闭防火墙
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
查看系统开启了中哪些服务
service --status-all
如何查看CPU内在使用情况? 命令:top
添加PATH
#export PATH=$PATH:/opt/au1200_rm/build_tools/bin
查看 export more
开机启动
将开机启动移除: update-rc.d <basename> remove [更多]
查找文件
which 查看可执行文件的位置。
whereis 查看文件的位置。
locate 配合数据库查看文件位置。
find 实际搜寻硬盘查询文件名称。
驱动挂载&卸载
Ubuntu16.04.2、centOS6.5
mount /dev/cdrom /mnt/ #持载
umount /mnt #卸载
umount -fl /mnt #出现"Device is busy"
密码重置
tip:ubuntu14.6
在启动界面按Esc进入启动项选择,
选择按e编辑启动项, 如图:
移动光标到linux /boot/vmlinuz...这行,修改最后quit splash $vt_handoff为quit splash rw init=/bin/bash 类似实际情况字母可能不一样
按F10重启
提示修改密码:passwd <用户名>
按F10重启
初始密码
没有默认的,因为你还没给root设置密码,第一个 user 是在 admin 组 ,所以他可以给 root 设置密码 , so
sudo passwd root [sudo] password for you :---> 输入你的密码,不会显示
Enter new UNIX password:
--- > 设置root 密码 Retype new UNIX password:
--> 重复