Linux常用命令
type 区别指定的命令是内部或外部命令
[root@centos8 ~]# type -a ls
ls is aliased to `ls --color=auto'
ls is /usr/bin/l
help 内部命令列表
[root@centos8 ~]# help echo
echo: echo [-neE] [arg ...]
Write arguments to the standard output.
enable 管理内部命令
enable cmd 启用内部命令
enable –n cmd 禁用内部命令
enable –n 查看所有禁用的内部命令
[root@centos8 ~]# enable /*查看所有的内部命令
[root@centos8 ~]# enable -n echo /*禁用内部命令
[root@centos8 ~]# enable -n /*查看所有禁用的内部命令
enable -n echo
[root@centos8 ~]# enable echo /*启用内部命令
lscpu命令可以查看cpu信息
cat /proc/cpuinfo也可看查看到
[root@centos8 ~]# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 2
On-line CPU(s) list: 0,1
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 2
NUMA node(s): 1
Vendor ID: AuthenticAMD
BIOS Vendor ID: AuthenticAMD
CPU family: 23
Model: 24
Model name: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx
BIOS Model name: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx
free查看内存
[root@centos8 ~]# free -h
total used free shared buff/cache available
Mem: 1.7Gi 632Mi 517Mi 10Mi 640Mi 996Mi
Swap: 2.0Gi 0B 2.0Gi
lsblk查看分区情况
[root@centos8 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 200G 0 disk
├─sda1 8:1 0 1G 0 part /boot
├─sda2 8:2 0 100G 0 part /
├─sda3 8:3 0 2G 0 part [SWAP]
├─sda4 8:4 0 1K 0 part
└─sda5 8:5 0 50G 0 part /data
sr0 11:0 1 1024M 0 rom
echo输出字符串或者提取shell变量的值
[root@centos8 ~]# echo "holle word"
holle word
[root@centos8 ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
screen命令多重视窗管理程序
[root@centos8 ~]# screen -ls
No Sockets found in /run/screen/S-root.
date命令显示日期与时间
[root@centos8 ~]# date
Thu Mar 31 20:47:30 CST 2022
ifconfig命令显示或设置网络设备
[root@centos8 ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.0.101 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 fe80::20c:29ff:fe30:437c prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:30:43:7c txqueuelen 1000 (Ethernet)
RX packets 2522 bytes 839438 (819.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1933 bytes 170993 (166.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
export命令系统设置
[root@centos8 ~]# export -p
declare -x DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/0/bus"
declare -x HISTCONTROL="ignoredups"
declare -x HISTSIZE="1000"
declare -x HISTTIMEFORMAT="%H:%M"
declare -x HOME="/root"
declare -x HOSTNAME="centos8.org"
declare -x LANG="en_US.UTF-8"
declare -x LESSOPEN="||/usr/bin/lesspipe.sh %s"
declare -x LOGNAME="root"