【Linux命令】鸟哥Linux基础第一部分:Linux规则与安装

1、查看主机内部各组件型号

cat /proc/cpuinfo
或者:
lspci

2、查看Linux内核版本、操作系统架构版本

uname -r  #查看Linux内核版本

uname -m  #查看操作系统架构版本

3、关闭GNOME默认的界面切换的动画功能

gsettings set org.gnome.desktop.interface enable-animations false

4、查看文件属性

显示家目录下的所有文件的详细属性信息
ls -al ~ 

查看文件创建信息中的完整的时间格式:
ls -al --full-time ~

5 日期与日历

显示日期
date 
date +%Y%m%d
date +%H:%M 
查看日历
cal 会显示当月日历
cal [month] [year]
cal 10 2020 会显示2020年10月份的日历
cal 2020 会显示全年日历

6 语言语系

查看当前使用的语系(排除乱码情况)
locale

设置为英文语系
export LC_ALL=en_US.utf8

7计算器

计算器
bc
scale=3 显示3位小数
quit 退出计算器

8 快捷键

ctrl + d  退出或关闭当前终端,相当于exit
shift + PageDown 向下翻页
shift + PageUp  向上翻页

9 寻找帮助

命令名称 --help
如:
date --help
man 名称
如:
man date
man -f date #这是指令或文件名称搜索
man -k date # 这是关键字搜索

whatis命令的使用可能需要用root身份建立whatis数据库:root下执行mandb即可
whatis [command or filename] # 相当于man -f [command or filename] 
apropos [command or filename] #  相当于man -k [command or filename] 
info 名称

10 了解主机目前的使用状态

who    这句命令可以在关机之前先看看哪个用户在线

netstat -a  这句命令可以查看网络的联机状态

ps -aux    这句命令可以查看后台执行的程序

11 关机与重启

sync     这是将数据同步写入磁盘

shutdown  				系统将在1分钟后关闭
shutdown [-krhc] [时间] [警告信息]
shutdown -h now 		立刻关机
shutdown -r now 		立刻重启
shutdown -h 20:25 		在今天的晚上八点25分关机
shutdown -h +10 		在10分钟后关机
shutdown -r +30 'The system will reboot after 30 min'
shutdown -k 'The system will reboot'  仅发出警告信息,并不会关机
shutdown -c  			取消这次关机命令


reboot  这3个命令都是关机与重启有关
halt
poweroff

systemctl [命令]  systemctl是与关机有关的命令的鼻祖

12 切换成root身份,从root切回普通用户

su -
exit

posted on 2020-04-19 16:15  丁错儿  阅读(1)  评论(0编辑  收藏  举报

导航