基本命令
新建用户名
useradd wuc
passwd wuc # 交互式设置密码
cd /etc/sysconfig/network-scripts/ # 切换文件夹
pwd # 查看当前所在的文件夹
shell命令
命令 选项 参数
ls -l /boot
date # 现在时间
hwclock -w #把系统时间同步给硬件
uname -r 内核
uname -a 版本信息
uname -m cpu架构
基础命令
# 设置时区
timedatectl set-timezone 'Asia/Shanghai'
重启
shutdown -r 0
shutdown -r now
init 6
reboot
shutdown -r 10
shutdown -r 11:30
关机
shutdown -h 0
shutdown -h now
init 0
poweroff
shutdown -c 取消之前关机命令
退出
exit
logout
ctrl+d
bash解释器特性
命令和文件自动补全<tab> 注意:Tab只能补全命令和文件
ctrl+c 结束程序运行
ctrl+d 退出
ctrl+a 光标移动到最前端
ctrl+e 光标移动到最后端
ctrl+r 搜索上方最近的一条关键词
!$ 引用上一个命令的最后一个参数
history 查看历史命令
history -c 清空历史命令
vim /root/.bash_history
打开history之后!加数字可执行对应历史程序
别名
方式一、 while ls 查看命令所在的真正的文件夹
方式二
\ls
方式三
unalias ls