Linux 常用命令

查看显卡信息
复制代码
* 安装了nvidia驱动之后可以使用该命令
nvidia-smi
查看cpu信息
复制代码
lscpu
查看磁盘信息
复制代码
df -h
查看Linux是虚拟机还是物理机
复制代码
# dmidecode -s system-product-name

#物理服务器
[root@JX-P-L-KVM-231 ~]# dmidecode -s system-product-name
# SMBIOS implementations newer than version 2.7 are not
# fully supported by this version of dmidecode.
PowerEdge R930
 
# KVM 虚拟主机
[root@JX-V-L-PHP-237 ~]# dmidecode -s system-product-name
KVM
 
# VMware vSphere 虚拟主机
[root@ZE-T1 ~]# dmidecode -s system-product-name
VMware Virtual Platform
 
#阿里云主机
[root@zdc ~]# dmidecode -s system-product-name
HVM domU
# dmesg | grep -i virtual

#物理服务器
[root@JX-P-L-KVM-231 ~]# dmesg | grep -i virtual  #没有内容
[root@JX-P-L-KVM-231 ~]#
 
# KVM 虚拟主机
[root@JX-V-L-PHP-237 ~]#  dmesg | grep -i virtual
Booting paravirtualized kernel on KVM
CPU0: Intel QEMU Virtual CPU version (cpu64-rhel6) stepping 03
input: Macintosh mouse button emulation as /devices/virtual/input/input1
 
# VMware vSphere
[root@ZE-T1 ~]# dmesg | grep -i virtual
DMI: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/30/2013
Booting paravirtualized kernel on bare hardware
input: Macintosh mouse button emulation as /devices/virtual/input/input1
scsi 0:0:0:0: Direct-Access     VMware   Virtual disk     1.0  PQ: 0 ANSI: 2
ata2.00: ATAPI: VMware Virtual IDE CDROM Drive, 00000001, max UDMA/33
VMware vmxnet3 virtual NIC driver - version 1.4.2.0-k-NAPI、
 
#阿里云主机
[root@zdc ~]#  dmesg | grep -i virtual
Booting paravirtualized kernel on Xen
input: Macintosh mouse button emulation as /devices/virtual/input/input2
Initialising Xen virtual ethernet driver.
# cat /proc/scsi/scsi | grep Vendor

# 物理服务器 
[root@JX-P-L-KVM-231 ~]# cat /proc/scsi/scsi | grep Vendor
  Vendor: DELL     Model: PERC H730P Adp   Rev: 4.27
  Vendor: PLDS     Model: DVD-ROM DS-8DBSH Rev: RD51
 
# KVM 虚拟主机
[root@JX-V-L-PHP-237 ~]# cat /proc/scsi/scsi | grep Vendor
  Vendor: QEMU     Model: QEMU DVD-ROM     Rev: 0.12
 
# VMware vSphere
[root@ZE-T1 ~]# cat /proc/scsi/scsi | grep Vendor
  Vendor: VMware   Model: Virtual disk     Rev: 1.0 
  Vendor: NECVMWar Model: VMware IDE CDR10 Rev: 1.00
 
# 阿里云主机 
[root@zdc ~]#  cat /proc/scsi/scsi 
Attached devices:
查看内存情况
复制代码
free -h
tar
复制代码
解包:tar zxvf FileName.tar
打包:tar czvf FileName.tar DirName
scp
复制代码
scp -r 用户名@ip或者域名:物理机文件路径  粘贴后路径
cp
复制代码
cp 被粘贴文件路径 粘贴到的文件路径
rm (慎用)
复制代码
rm -rf 要删除的文件夹或文件
相关推荐
cosX+sinY18 分钟前
ubuntu 20.04 编译运行lio-sam,并保存为pcd
linux·ubuntu·机器人
Lalolander25 分钟前
设备制造行业如何避免项目管理混乱?
运维·制造·工程项目管理·四算一控·epc·环保设备工程·设备制造
LucianaiB44 分钟前
【金仓数据库征文】_AI 赋能数据库运维:金仓KES的智能化未来
运维·数据库·人工智能·金仓数据库 2025 征文·数据库平替用金仓
prinrf('千寻)1 小时前
nacos设置权重进行负载均衡不生效
运维·负载均衡
Lary_Rock1 小时前
Android 编译问题 prebuilts/clang/host/linux-x86
android·linux·运维
熬夜学编程的小王1 小时前
【Linux篇】理解信号:如何通过信号让程序听从操作系统的指令
linux·信号产生·软件条件产生信号
子非衣1 小时前
Windows云主机远程连接提示“出现了内部错误”
服务器·windows
绵绵细雨中的乡音1 小时前
Linux进程学习【基本认知】
linux·运维·学习
Johny_Zhao2 小时前
MySQL 高可用集群搭建部署
linux·人工智能·mysql·信息安全·云计算·shell·yum源·系统运维·itsm
lLinkl2 小时前
项目笔记2:post请求是什么,还有什么请求
服务器·网络协议·http