Linux常见命令

一、系统管理

1.1、查看系统

  • cat os-release
[root@aliyun etc]# cat os-release 
NAME="Alibaba Cloud Linux"
VERSION="3 (Soaring Falcon)"
ID="alinux"
ID_LIKE="rhel fedora centos anolis"
VERSION_ID="3"
PLATFORM_ID="platform:al8"
PRETTY_NAME="Alibaba Cloud Linux 3 (Soaring Falcon)"
ANSI_COLOR="0;31"
HOME_URL="https://www.aliyun.com/"

1.2、查看内核

  • uname
[root@aliyun etc]# uname -r
5.10.134-15.al8.x86_64
[root@aliyun etc]# uname -a
Linux aliyun 5.10.134-15.al8.x86_64 #1 SMP Thu Jul 20 00:44:04 CST 2023 x86_64 x86_64 x86_64 GNU/Linux

二、网络

2.1、查看网络

  • ip addr
[root@aliyun etc]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:16:3e:08:32:2e brd ff:ff:ff:ff:ff:ff
    altname enp0s3
    altname ens3
    inet 172.19.155.123/20 brd 172.19.159.255 scope global dynamic noprefixroute eth0
       valid_lft 315347874sec preferred_lft 315347874sec
    inet6 fe80::216:3eff:fe08:322e/64 scope link 
       valid_lft forever preferred_lft forever
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:16:d2:25:0c brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
4: br-145736cb7265: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:94:30:fe:1c brd ff:ff:ff:ff:ff:ff
    inet 172.18.0.1/16 brd 172.18.255.255 scope global br-145736cb7265
       valid_lft forever preferred_lft forever
    inet6 fe80::42:94ff:fe30:fe1c/64 scope link 
       valid_lft forever preferred_lft forever
7: br-a466fef3808a: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:60:fb:ee:fe brd ff:ff:ff:ff:ff:ff
    inet 172.20.0.1/16 brd 172.20.255.255 scope global br-a466fef3808a
       valid_lft forever preferred_lft forever
    inet6 fe80::42:60ff:fefb:eefe/64 scope link 
       valid_lft forever preferred_lft forever
9: veth548592c@if8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-a466fef3808a state UP group default 
    link/ether 86:50:e0:8b:58:90 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::8450:e0ff:fe8b:5890/64 scope link 
       valid_lft forever preferred_lft forever

2.2、网卡

  • ifconfig
ifconfig eth0 up   # 启动网卡eth0
ifconfig eth0 down   # 关闭网卡eth0
# 查看单独网卡信息
[root@aliyun etc]# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.19.155.123  netmask 255.255.240.0  broadcast 172.19.159.255
        inet6 fe80::216:3eff:fe08:322e  prefixlen 64  scopeid 0x20<link>
        ether 00:16:3e:08:32:2e  txqueuelen 1000  (Ethernet)
        RX packets 427500  bytes 479730114 (457.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 212578  bytes 78882795 (75.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

三、查询

  • rpm -qa | grep docker
[root@aliyun etc]# rpm -qa | grep docker
docker-buildx-plugin-0.11.2-1.el8.x86_64
docker-ce-24.0.7-1.el8.x86_64
docker-ce-cli-24.0.7-1.el8.x86_64
docker-compose-plugin-2.21.0-1.el8.x86_64
docker-ce-rootless-extras-24.0.7-1.el8.x86_64
posted @ 2024-01-04 20:22  his365  阅读(20)  评论(0编辑  收藏  举报