linux(1) 之 查看操作系统基本信息

20 篇文章 0 订阅

linux上 shell 的指令操作 ,指令。

 

 

 

指令:

 

 uname -o: 查看操作系统类型  

 uname -n: 查看用户名 

 uname -m:查看 cpu 的指令集

uname -a: 查看操作系统内核信息

 

 

Usage: uname [OPTION]...

Print certain system information.  With no OPTION, same as -s.

 

  -a, --all                print all information, in the following order,

                             except omit -p and -i if unknown:

  -s, --kernel-name        print the kernel name

  -n, --nodename           print the network node hostname

  -r, --kernel-release     print the kernel release

  -v, --kernel-version     print the kernel version

  -m, --machine            print the machine hardware name

  -p, --processor          print the processor type or "unknown"

  -i, --hardware-platform  print the hardware platform or "unknown"

  -o, --operating-system   print the operating system

      --help     display this help and exit

      --version  output version information and exit

 

 

 

hostname -i: 查看内网ip

curl -s ipecho.net/plain: 查看外网ip 

ping -c  2 baidu.com : ping一下外网方式

who:查看 当前登录用户数

 

 

获取操作系统的内容:

free -m:获取操作系统内容 

 

top -n 1  :   查看cpu 使用情况


top -n 1   b : 查看cpu 使用情况

 

 

 

查看磁盘信息

 

ds -f:

root@aliyun247 ~]# df -h

Filesystem      Size  Used Avail Use% Mounted on

 

/dev/xvda1       20G  5.8G   13G  31% /

 

tmpfs           7.8G     0  7.8G   0% /dev/shm

 

/dev/xvdb1      493G  3.7G  464G   1% /data

 

 

 

[root@aliyun247 ~]# df -h  |grep  -vE  'Filesystem'
/dev/xvda1       20G  5.8G   13G  31% /
tmpfs           7.8G     0  7.8G   0% /dev/shm
/dev/xvdb1      493G  3.7G  464G   1% /data

 

 

[root@aliyun247 ~]# df -hP |grep  -vE  'Filesystem' |awk '{print $1 $5}'
/dev/xvda 131%
tmpfs 0%
/dev/xvdb 11%

 

 

[root@aliyun247 ~]# df -hP|grep  -vE 'Filesystem|tmpfs' |awk '{print $1 $5}'
/dev/xvda131%
/dev/xvdb11%

 

 

[root@aliyun247 ~]# df -hP|grep  -vE 'Filesystem | tmpfs' |awk '{print $1 $5}'
/dev/xvda131%
tmpfs0%
/dev/xvdb11%

 

注意: -vE 'Fileyste|tempfs'  | 直接的字段内容不能空格

 

 

 

Filesystem      :磁盘设备名称

Size:设备总容量

Used: 已用容量

Avail: 可用容量

Use%:  使用容量百分比

Mounted on: 设备挂载的系统目录文件 

 

 

 

1  主控制脚本的实现

 

2 系统信息及运行状态的获取

 

3 ngnix和mysql 运行状态分析

 

4 应用日志分析  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值