1. View all hardware information of the machine:
dmidecode |more
dmesg |more
There is a lot of information from these two commands, so it is recommended to use "|more" later for easy viewing
2. View CPU information
method one:
CPU-related parameters under Linux are stored in the /proc/cpuinfo file
cat /proc/cpuinfo |more
Method Two:
Use the command dmesg | grep CPU to view the startup information of the relevant CPU
Check the number of CPU bits:
getconf LONG_BIT
3. View Mem information
cat /proc/meminfo |more (note the last line of the output: MachineMem: 41932272 kB)
free -m
top
4. View disk information
method one:
fdisk -l can see the partition and size information of the disk (including U disk) on the system.
Method Two:
view directly
cat /proc/partitions
5. View network card information
method one:
ethtool eth0 Use this command to view the technical indicators related to the network card
(Not necessarily all network cards support this command)
ethtool -i eth1 plus the -i parameter to view the network card driver
You can try other parameters to view the related technical parameters of the network card
Method Two:
You can also see the network card name (manufacturer) and other information through dmesg | grep eth0, etc.
By viewing /etc/sysconfig/network-scripts/ifcfg-eth0, you can see the current network card configuration including IP, gateway address and other information.
Of course, it can also be viewed through the ifconfig command.
6. How to check the motherboard information?
lspci
7. How to mount the ISO file
mount -o loop *.iso mount_point
8. How to check the information about the disc
method one:
After inserting the CD, in my RHEL5 system, the CD file is /dev/cdrom,
So just mount /dev/cdrom mount_point.
[root@miix tmp]# mount /dev/cdrom mount_point
mount: block device /dev/cdrom is write-protected, mounting read-only
In fact, take a closer look, the device file of the optical drive is hdc
[root@miix tmp]# ls -l /dev/cdrom*
lrwxrwxrwx 1 root root 3 01-08 08:54 /dev/cdrom -> hdc
lrwxrwxrwx 1 root root 3 01-08 08:54 /dev/cdrom-hdc -> hdc
So we can also mount /dev/hdc mount_point like this
If there is no valid CD in the CD-ROM, an error will be reported:
[root@miix tmp]# mount /dev/hdc mount_point
mount: media not found
9. How to check USB device related
method one:
In fact, through the fdisk -l command, you can view the information of the connected U disk. My U disk information is as follows:
Disk /dev/sda: 2012 MB, 2012217344 bytes
16 heads, 32 sectors/track, 7676 cylinders
Units = cylinders of 512 * 512 = 262144 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 16 7676 1961024 b W95 FAT32
The device file of the U disk is /dev/sda, 2G in size, in FAT32 format.
If the user does not log in to the Linux GUI, the U disk will not be automatically mounted.
At this point, you can manually mount (mount):
mount /dev/sda1 mount_point
The above command mounts the U disk to the mount_point directory of the current directory. Note that it is sda1 instead of sda.
The unmount command is umount mount_point
Linux does not have a built-in driver that supports NTFS formatted disks by default, but it supports FAT32 well, and the -t vfat parameter is generally not required when mounting.
If ntfs is supported, the -t ntfs parameter should be used for ntfs formatted disk partitions.
If there is garbled characters, you can consider using the -o iocharset= character set parameter.
You can view USB device information with the lsusb command:
[root@miix tmp]# lsusb
Bus 001 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 004 Device 002: ID 0951:1613 Kingston Technology
Bus 004 Device 001: ID 0000:0000
===================================================
Get memory, cpu real core number method
===================================================
Linux memory viewing method
The following shows that free is the current memory usage displayed, and -m means M bytes to display the content. Let's take a look.
$ free -m
total used free shared buffers cached
Mem: 1002 769 232 0 62 421
-/+ buffers/cache: 286 715
Swap: 1153 0 1153
The first part of the Mem line:
total total memory: 1002M
used Memory used: 769M
free free memory: 232M
shared is currently deprecated, always 0
buffers Buffer buffer memory: 62M
cached Page cache memory: 421M
Relationship: total(1002M) = used(769M) + free(232M)
Second part (-/+ buffers/cache):
(-buffers/cache) Number of used memory: 286M (refer to used - buffers - cached in the first part of the Mem line)
(+buffers/cache) Number of free memory: 715M (refers to the free + buffers + cached in the first part of the Mem line)
It can be seen that -buffers/cache reflects the memory actually eaten by the program, while +buffers/cache reflects the total amount of memory that can be used.
The third part refers to the swap partition, I think everyone understands it without talking about it.
I think everyone is dizzy after reading the above. Why is the used and free so strange in the results of the first part (Mem) and the second part (-/+ buffers/cache).
Actually, we can explain it from two aspects.
For the operating system, the parameters of Mem.buffers/cached are all used, so it thinks that free is only 232.
For applications, (-/+ buffers/cach).buffers/cached is equally available, because buffer/cached is to improve the performance of program execution. When the program uses memory, buffer/cached will be used quickly .
So, let's take a look at the application, mainly the free and used of (-/+ buffers/cache). So let's just look at this. In addition, I will tell you some common sense. In order to improve the efficiency of disk and memory access, Linux does After a lot of careful design, in addition to caching dentry (for VFS, to accelerate the conversion of file pathnames to inodes), two main Cache methods are also adopted: Buffer Cache and Page Cache. The former is for reading and writing of disk blocks, and the latter is for reading and writing of file inodes. These Caches can effectively shorten the time of I/O system calls (such as read, write, getdents).
Remember that memory is for use, not for viewing. Unlike windows, no matter how much real physical memory you have, it has to use the hard disk swap file to read. This is why windows often prompts insufficient virtual space. Think about it, how boring, when there is still most of the memory, take out a part of the hard disk space as memory. How can the hard disk be faster than the memory. So let's look at Linux, as long as you don't need swap space, you don't have to worry about your own Too little memory. If you often use a lot of swap, you may need to consider adding physical memory. This is also the standard for Linux to see if the memory is sufficient.
Check the real number of CPU cores under Linux
Many people know that you can see detailed cpu information directly by typing cat /proc/cpuinfo.
The information will be divided into processor 0-n. If you think that n is the real number of cores of the cpu, you are wrong.
We know that Intel has Hyper-Threading Technology (HT), which can logically double the number of CPUs. Therefore, it is not accurate to look at the number of processors.
The actual number of cores should be the parameter value of cpu cores.
[admin@transmit180 logs]$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Xeon(R) CPU E5310 @ 1.60GHz
stepping : 7
cpu MHz : 1596.035
cache size : 4096 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 4
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl tm2 xtpr
bogomips : 3194.26
The number of physical cpus, and there are several physical ids that can be counted without repetition.