博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
查看linux服务器配置信息
阅读量:4203 次
发布时间:2019-05-26

本文共 3838 字,大约阅读时间需要 12 分钟。

查看版本当前操作系统内核信息

[root@vm319t003 opt]# uname -aLinux vm319t003.yto.cloud 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

查看当前操作系统版本信息

[root@vm319t003 opt]# cat /proc/versionLinux version 3.10.0-693.21.1.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) ) #1 SMP Wed Mar 7 19:03:37 UTC 2018

查看端口号占用

[root@localhost ~]# lsof -i:8090COMMAND  PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAMEjava    6315 root   21u  IPv6 1258560      0t0  TCP *:8090 (LISTEN)[root@localhost ~]# netstat -apn | grep 8090tcp6       0      0 :::8090                 :::*                    LISTEN      6315/java           [root@localhost ~]# netstat -anlp | grep 9992[root@localhost ~]# netstat -anlp | grep 8090tcp6       0      0 :::8090                 :::*                    LISTEN      6315/java

查找文件夹和文件

  • 根目录下查找application.properties文件
find / -name application.properties
  • 根目录下查找app_service文件夹
find / -name app_service -type d

内存

  • Linux free命令用于显示内存状态。

free指令会显示内存的使用情况,包括实体内存,虚拟的交换文件内存,共享内存区段,以及系统核心使用的缓冲区等。

[root@host-192-168-4-200 ~]# free             total       used       free     shared    buffers     cachedMem:       6931468    5599092    1332376          0       9976     101712-/+ buffers/cache:    5487404    1444064Swap:      4128760    3717832     410928
  • 对于free命令,可以加上-m参数,使其显示单位为Mb
[root@host-192-168-4-200 ~]# free -m             total       used       free     shared    buffers     cachedMem:          6769       5957        811          0          5         51-/+ buffers/cache:       5899        869Swap:         4031       3971         60

硬盘

  • df命令用于显示磁盘分区上的可使用的磁盘空间
[root@host-192-168-4-68 ~]# df -h Filesystem                    Size  Used Avail Use% Mounted on/dev/mapper/VolGroup-lv_root  537G   38G  472G   8% /tmpfs                          16G     0   16G   0% /dev/shm/dev/vda1                     485M   39M  421M   9% /boot
  • 查看硬盘和分区分布
[root@host-192-168-4-200 ~]# lsblkNAME                        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTvda                         252:0    0    50G  0 disk ├─vda1                      252:1    0   500M  0 part /boot└─vda2                      252:2    0  49.5G  0 part   ├─VolGroup-lv_root (dm-0) 253:0    0 144.6G  0 lvm  /  └─VolGroup-lv_swap (dm-1) 253:1    0     4G  0 lvm  [SWAP]vdb                         252:16   0   100G  0 disk └─VolGroup-lv_root (dm-0)   253:0    0 144.6G  0 lvm  /
  • 查看硬盘和分区的详细信息
[root@host-192-168-4-200 ~]# fdisk -lDisk /dev/vda: 53.7 GB, 53687091200 bytes16 heads, 63 sectors/track, 104025 cylindersUnits = cylinders of 1008 * 512 = 516096 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x000bd363   Device Boot      Start         End      Blocks   Id  System/dev/vda1   *           3        1018      512000   83  LinuxPartition 1 does not end on cylinder boundary./dev/vda2            1018      104026    51915776   8e  Linux LVMPartition 2 does not end on cylinder boundary.Disk /dev/vdb: 107.4 GB, 107374182400 bytes16 heads, 63 sectors/track, 208050 cylindersUnits = cylinders of 1008 * 512 = 516096 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000Disk /dev/mapper/VolGroup-lv_root: 155.2 GB, 155231191040 bytes255 heads, 63 sectors/track, 18872 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000Disk /dev/mapper/VolGroup-lv_swap: 4227 MB, 4227858432 bytes255 heads, 63 sectors/track, 514 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000

转载地址:http://xnvli.baihongyu.com/

你可能感兴趣的文章
php oauth 模块在linux下安装
查看>>
代替nginx的服务器 - The Tengine Web Server
查看>>
nginx 升级成 tengine 的代码
查看>>
magento rest api 调用
查看>>
magento rest api 调用!
查看>>
magento rest api get Token key and secret
查看>>
谷歌获取货币汇率代码
查看>>
安装nginx
查看>>
手动6 - 隐藏Nginx版本号
查看>>
手动7 - nginx 日志切割
查看>>
magento - 使用后台设置的时间用法
查看>>
Linux常用命令
查看>>
清除文件中的.svn文件
查看>>
手动11 -nginx 优化配置
查看>>
php加速器 - zendopcache
查看>>
手动12 - 安装php加速器 Zend OPcache
查看>>
set theme -yii2
查看>>
yii2 - 模块(modules)的view 映射到theme里面
查看>>
yii2 - controller
查看>>
yii2 - 增加actions
查看>>