Linux 日常操作

1 查看硬件信息

 

1.1 服务器型号序列号

dmidecode|grep "System Information" -A9|egrep "Manufacturer|Product|Serial" 示例:

[root@halberd1 ~]# dmidecode|grep "System Information" -A9|egrep  "Manufacturer|Product|Serial"
Manufacturer: VMware, Inc.
Product Name: VMware Virtual Platform
Serial Number: VMware-56 4d ed 7d 00 f8 90 c2-76 6f d8 36 bb da 40 9e

1.2 主板型号

dmidecode |grep -A16 "System Information$"

1.3 查看BIOS信息

dmidecode -t bios

1.4 查看内存槽及内存条

# 查看内存槽
dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range
# 查看最大支持内存容量
dmidecode|grep -P 'Maximum\s+Capacity'
# 查看内存的频率
dmidecode|grep -A16 "MemoryDevice"|grep 'Speed'

1.5 查看CPU

# 查看CPU信息(型号)
[root@AAA ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
Intel(R) Xeon(R) CPU E5-2630 0 @ 2.30GHz # 查看物理CPU个数
[root@AAA ~]# cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l # 查看每个物理CPU中core的个数(即核数)
[root@AAA ~]# cat /proc/cpuinfo| grep "cpu cores"| uniq
cpu cores : 6 # 查看逻辑CPU的个数
[root@AAA ~]# cat /proc/cpuinfo| grep "processor"| wc -l

1.6 查看内存

dmidecode -t memory|grep -E 'Asset|Manufacturer'

1.7 查看磁盘基本信息

使用 smartctl -x <device> 命令来查看厂商,型号等。

[root@halberd1 ~]# smartctl -x /dev/sda1
smartctl 6.6 2017-11-05 r4594 [x86_64-linux-4.18.0-147.el8.x86_64] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION ===
Vendor: VMware
Product: Virtual disk
Revision: 1.0
User Capacity: 107,374,182,400 bytes [107 GB]
Logical block size: 512 bytes
LU is fully provisioned
Device type: disk
Local Time is: Tue Apr 28 23:59:27 2020 EDT
SMART support is: Unavailable - device lacks SMART capability.
Read Cache is: Unavailable
Writeback Cache is: Unavailable === START OF READ SMART DATA SECTION ===
Current Drive Temperature: 0 C
Drive Trip Temperature: 0 C Error Counter logging not supported Device does not support Self Test logging
Device does not support Background scan results logging

1.8 查看网卡基本信息

使用lshw 命令来查看

[root@halberd1 ~]# lshw -c network
*-network
description: Ethernet interface
product: VMXNET3 Ethernet Controller
vendor: VMware
physical id: 0
bus info: pci@0000:0b:00.0
logical name: ens192
version: 01
serial: 00:0c:29:da:40:9e
size: 10Gbit/s
capacity: 10Gbit/s
width: 32 bits
clock: 33MHz
capabilities: pm pciexpress msi msix bus_master cap_list rom ethernet physical logical tp 1000bt-fd 10000bt-fd
configuration: autonegotiation=off broadcast=yes driver=vmxnet3 driverversion=1.4.16.0-k-NAPI duplex=full ip=10.10.100.150 latency=0 link=yes multicast=yes port=twisted pair speed=10Gbit/s
resources: irq:19 memory:fd4fc000-fd4fcfff memory:fd4fd000-fd4fdfff memory:fd4fe000-fd4fffff ioport:5000(size=16) memory:fd400000-fd40ffff
*-network
description: Ethernet interface
product: VMXNET3 Ethernet Controller
vendor: VMware
physical id: 0
bus info: pci@0000:13:00.0
logical name: ens224
version: 01
serial: 00:0c:29:da:40:a8
size: 10Gbit/s
capacity: 10Gbit/s
width: 32 bits
clock: 33MHz
capabilities: pm pciexpress msi msix bus_master cap_list rom ethernet physical logical tp 1000bt-fd 10000bt-fd
configuration: autonegotiation=off broadcast=yes driver=vmxnet3 driverversion=1.4.16.0-k-NAPI duplex=full ip=172.26.9.19 latency=0 link=yes multicast=yes port=twisted pair speed=10Gbit/s
resources: irq:16 memory:fd3fc000-fd3fcfff memory:fd3fd000-fd3fdfff memory:fd3fe000-fd3fffff ioport:6000(size=16) memory:fd300000-fd30ffff

2 性能分析

 

2.1 占用CPU最高的进程

ps -aux | sort -k3nr | head -n 10 或者使用pidstat 命令,示例如下:

pidstat -ul| head -3;pidstat -u |awk '{if ($6 >1) print $0}'

只是pid 的命令不是很合适,因为不同的操作系统输出的列数不是固定的。需要自行修改awk if 中的$6。

2.2 占用物理内存最多的进程

ps -aux | sort -k4nr | head -n 10

2.3 占用swap空间最多的进程

2.4 占用IO最高的进程

3 时间相关

  • 修改时区

    • CentOS 7 /CentOS8
    timedatectl set-timezone 'Asia/Shanghai'
    

Author: halberd.lee

Created: 2020-04-29 Wed 18:04

Validate

Linux 日常操作的更多相关文章

  1. LINUX日常操作二

    参见:Linux日常操作一  selinux 开启和关闭 一.查看SELinux状态:1./usr/sbin/sestatus -v      ##如果SELinux status参数为enabled ...

  2. Linux日常操作整理

    1. Linux下建立ssh互信 需要在两台机器上保证安装ssh步骤:cd ~/.sshssh-keygen(每台机器执行此操作)ssh root@192.168.2.100 cat ~/.ssh/i ...

  3. linux日常---3、linux常用操作

    linux日常---3.linux常用操作 一.总结 一句话总结: 状态的确是非常之好,享受这种状态. 1.linux删除文件夹和文件? rm -rf *:删文件和文件夹 rm -rf *.*:只能删 ...

  4. linux日常---2、lamp.sh安装lamp环境中的linux操作

    linux日常---2.lamp.sh安装lamp环境中的linux操作 一.总结 一句话总结: 学不如用,学一百遍还不如真正多用几遍的来的效果好 1.linux下查看进程命令? ps 常用 ps - ...

  5. Linux 日常常用指令

    最近搞了一个阿里ECS,CentOS7,涉及到一些基本的Linux指令,在这里总结一下,在搭环境中常用的一些指令,熟悉这些指令就基本能够使用CentOS进行日常操作了. 更多的可以参考系统自带的  “ ...

  6. linux日常使用指令总结

    linux 日常指令总结(ubuntu): ls -lha 所有文件及权限 df -h 系统磁盘空间 du -sh 当前目录大小 du -ah --max-depth=1 显示目录下所有的文件和文件夹 ...

  7. ORACLE日常操作手册

    转发自:http://blog.csdn.net/lichangzai/article/details/7955766 以前为开发人员编写的oracle基础操作手册,都基本的oracle操作和SQL语 ...

  8. linux日常---1、linux下安装、查看、卸载包常用命令

    linux日常---1.linux下安装.查看.卸载包常用命令 一.总结 一句话总结: 对比学习 1.linux如何查看系统中安装的程序? rpm -qa   # 查看所有安装的软件包 2.linux ...

  9. linux日常运维工作

    Linux的使用环境也日趋成熟,各种开源产品络绎不绝,大有百花齐放的盛景,那么当Linux落地企业,回归工作时,我们还要面对这Linux运维方面的诸多问题,今天我们特意组织一场有关Linux 在企业运 ...

随机推荐

  1. Ubuntu添加新用户并给普通用户赋予root新权限

    添加新用户 首先用adduser命令添加普通用户: #adduser newusername 只有在root权限才可以添加新用户 修改密码: #passwd username 赋予root权限 方法1 ...

  2. MySQL的MVCC机制

    1.MVCC简介 1.1 MVCC是什么? MVCC,Multi-Version Concurrency Control,多版本并发控制.MVCC 是一种并发控制的方法,一般在数据库管理系统中,实现对 ...

  3. 死磕Lambda表达式(六):Consumer、Predicate、Function复合

    你的无畏来源于无知.--<三体> 在上一篇文章(传送门)中介绍了Comparator复合,这次我们来介绍一下其他的复合Lambda表达式. Consumer复合 Consumer接口中,有 ...

  4. .net core系统跨平台部署手册

    前言 .net core跨平台版本基于.net core 3.1 SDK开发,剥离原来的基于MS Office进行文档转换功能的模块,使用基于开源跨平台的LibreOffice进行文档转换的模块.以此 ...

  5. NKOJ3768 数列操作

    问题描述 给出N个正整数数列a[1..N],再给出一个正整数k,现在可以重复进行如下操作:每次选择一个大于k的正整数a[i],将a[i]减去1,选择a[i-1]或a[i+1]中的一个加上1.经过一定次 ...

  6. 解决VS项目程序运行完就自动关闭窗口

    VS的程序运行完会关闭窗口,需要设置工程属性 笔者虽然是Java开发者,但是学习用到了C++与C语言,之前使用的是dev与codeblock并没有这个情况,那么如何解决 首先你有这个hello,wor ...

  7. js中使用Timer来计时程序执行时 - [javascript] - [开发]

    在我们开发过程中,我们也在不断的学习,以及优化自己的代码质量. 我们时常需要一个计时器,来对代码某段或者某些段执行进行计时,以评估代码运行质量,考虑是否优化. 以及优化后的直观对比. JavaScri ...

  8. 区分C++和Java的this

    区分C++和Java的this 今天早上写C++程序的时候,我习惯性地在程序中写了如下代码 void setY(int x){ this.x = x; } 编译器给我无情地报错了.后来想想,发现是自己 ...

  9. python--模块、列表生成式、集合元祖列表

    一.导入模块的两种方式 1.直接使用import import 模块名 #调用 模块名.方法名() 2.使用from…import… from 模块名 import 方法名1,方法名2(from 模块 ...

  10. 测试老司机都在用的表白神器你会吗?-Fiddler之AutoResponse线上调试

    一.Fiddler在线调试功能和表白神器介绍 ​ 在以往的工作中,线上有bug,就需要把文件弄到本地来改,但经常会碰见本地环境又和线上不一样,导致调试困难,闭着眼睛改好之后传到线上去看对不对,不对的话 ...