Linux查看服务器配置的命令,Linux服务器配置查看命令详解及实用技巧
- 综合资讯
- 2024-11-20 03:31:25
- 2

Linux查看服务器配置的命令包括ifconfig、ip addr、netstat等,详解包括配置文件位置、参数含义等。实用技巧包括使用grep、awk等工具筛选信息,...
Linux查看服务器配置的命令包括ifconfig、ip addr、netstat等,详解包括配置文件位置、参数含义等。实用技巧包括使用grep、awk等工具筛选信息,使用管道符连接命令实现更复杂的功能。掌握这些命令和技巧有助于更好地管理和优化Linux服务器配置。
Linux服务器配置查看命令概述
Linux服务器配置查看命令是运维人员日常工作中的重要工具,通过对服务器配置信息的查看,可以帮助我们了解服务器的运行状态、性能瓶颈、安全风险等问题,本文将详细介绍Linux服务器配置查看的相关命令,包括系统信息、网络信息、进程信息、磁盘信息等方面。
系统信息查看命令
1、uname:查看系统内核版本、主机名等信息。
[root@localhost ~]# uname -a Linux localhost 4.15.0-1057-owd #44-Ubuntu SMP Fri Feb 14 09:35:18 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
2、hostname:查看或设置主机名。
[root@localhost ~]# hostname localhost [root@localhost ~]# hostname newname [root@localhost ~]# hostname newname
3、hostnamectl:查看或设置主机名及相关信息。
[root@localhost ~]# hostnamectl Static hostname: newname Icon name: computer-vm Chassis: vm Machine ID: 5e7d5e7f0e6c4b3e9d8c8a7b8c9d9e0f Boot ID: 5c3968ee9c9142f3a5c1b6f8c7b8c9d9 Virtualization: kvm Operating System: Ubuntu 18.04.5 LTS Kernel: Linux 4.15.0-1057-owd Architecture: x86-64
4、lsb_release:查看Linux发行版信息。
[root@localhost ~]# lsb_release -a LSB Version: :core-4.1-amd64:core-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch Distributor ID: Ubuntu Description: Ubuntu 18.04.5 LTS Release: 18.04 Codename: bionic
网络信息查看命令
1、ifconfig:查看网络接口信息。
[root@localhost ~]# ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fe80::20c:29ff:fe1a:1000 prefixlen 64 scopeid 0x20<link> ether 00:0c:29:1a:10:00 txqueuelen 1000 (Ethernet) RX packets 83547 bytes 51060600 (49.0 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 91225 bytes 56367632 (54.0 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
2、ip:查看网络接口信息,功能更强大。
[root@localhost ~]# ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 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 pfifo_fast state UP group default link/ether 00:0c:29:1a:10:00 brd ff:ff:ff:ff:ff:ff inet 192.168.1.100/24 brd 192.168.1.255 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::20c:29ff:fe1a:1000/64 scope link valid_lft forever preferred_lft forever
3、netstat:查看网络连接、路由表、接口统计等信息。
[root@localhost ~]# netstat -tulnp Active Internet Connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 192.168.1.100:22 192.168.1.1:58824 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58825 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58826 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58827 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58828 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58829 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58830 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58831 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58832 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58833 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58834 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58835 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58836 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58837 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58838 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58839 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58840 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58841 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58842 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58843 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58844 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58845 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58846 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58847 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58848 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58849 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58850 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58851 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58852 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58853 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58854 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58855 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58856 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58857 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58858 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58859 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58860 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58861 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58862 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58863 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58864 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58865 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58866 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58867 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58868 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58869 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58870 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58871 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58872 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58873 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58874 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58875 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58876 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58877 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58878 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58879 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58880 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58881 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58882 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58883 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58884 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58885 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58886 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58887 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58888 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58889 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58890 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58891 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58892 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58893 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58894 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58895 ESTABLISHED 2019/python tcp 0 0 192.168.1.100:22 192.168.1.1:58896 ESTABLISHED
本文由智淘云于2024-11-20发表在智淘云,如有疑问,请联系我们。
本文链接:https://zhitaoyun.cn/963492.html
本文链接:https://zhitaoyun.cn/963492.html
发表评论