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 要删除的文件夹或文件
相关推荐
玉树临风江流儿9 分钟前
Linux驱动开发(速记版)--设备模型
linux·驱动开发
杰哥在此22 分钟前
Python知识点:如何使用Multiprocessing进行并行任务管理
linux·开发语言·python·面试·编程
枫叶丹42 小时前
【在Linux世界中追寻伟大的One Piece】进程信号
linux·运维·服务器
刻词梨木2 小时前
ubuntu中挂载点内存不足,分配不合理后使用软链接的注意事项
linux·运维·ubuntu
灯火不休ᝰ3 小时前
[win7] win7系统的下载及在虚拟机中详细安装过程(附有下载文件)
linux·运维·服务器
数云界6 小时前
如何在 DAX 中计算多个周期的移动平均线
java·服务器·前端
powerfulzyh7 小时前
Ubuntu24.04远程开机
linux·ubuntu·远程工作
ulimpid7 小时前
Command | Ubuntu 个别实用命令记录(新建用户、查看网速等)
linux·ubuntu·command
HHoao7 小时前
Ubuntu启动后第一次需要很久才能启动GTK应用问题
linux·运维·ubuntu
小灰兔的小白兔7 小时前
【Ubuntu】Ubuntu常用命令
linux·运维·ubuntu