Linux foundation -2

1, version macro function

#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
eg:printf("===%x\n",KERNEL_VERSION(2,6,11));

2, demsg: detection and control loop kernel buffer; display all the information

1、dmesg:dmesg --help查看用法
2、用root权限执行 cat /proc/kmsg,查看内核的调试信息
kmsg里面就是显示内核消息的,程序中printk的输出都可以看到,

3, boot information

开机信息亦保存在/var/log目录中;执行:cat /var/log查看

4, view system information

[ubuntu:root]$ hostnamectl
   Static hostname: ubuntu-virtual-machine
         Icon name: computer-vm
           Chassis: vm
        Machine ID: a310e68e764ffe92628ad74
           Boot ID: e03c392db5e22d892d148f0
    Virtualization: vmware
  Operating System: Ubuntu 16.04.4 LTS
            Kernel: Linux 4.13.0-36-generic
      Architecture: x86-64

5, see which release

[ubuntu:root]$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.4 LTS
Release:	    16.04
Codename:	    xenial

6, see the kernel and gcc version information

[ubuntu:root]$ cat /proc/version
Linux version 4.13.0-36-generic (buildd@lgw01-amd64-033) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9)) #40~16.04.1-Ubuntu SMP Fri Feb 16 23:25:58 UTC 2018

7, core edition

[ubuntu:root]$ uname -a
Linux ubuntu-virtual-machine 4.13.0-36-generic #40~16.04.1-Ubuntu SMP Fri Feb 16 23:25:58 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

8, if the REDHAT system can also view

[root@root]# cat /etc/redhat-release 
CentOS Linux release 7.4.1708 (Core) 

9, a multilayer directory file format to be converted, the dos2unix -r without recursion instruction or the like, it is necessary to find also in combination with the pipe.
find -type f | xargs dos2unix -o 

 

 

Published 78 original articles · won praise 9 · views 10000 +

Guess you like

Origin blog.csdn.net/heguangsui123/article/details/102746333