Common Linux Operations--"continuous grooming"

Source: Internet
Author: User

1. View kernel information, operating system information

The version information of the operating system can be accomplished by the following commands, such as: Lsb_release-a;cat/etc/issue

The view kernel version can be done by the following command, for example: Uname-a;cat/proc/version,

1. View the operating system version of the command 1.1 command lsb_release-a

Lsb_release provides information about specific LSB (Linux standard Base) and release versions.

The results of running lsb_release-a in Ubuntu are as follows:

[Plain]View Plaincopyprint?
    1. [Email protected]:~$ lsb_release-a
    2. No LSB modules is available.
    3. Distributor Id:ubuntu
    4. Description:ubuntu 11.10
    5. release:11.10
    6. Codename:oneiric
    7. [Email protected]:~$

1.2 Command Cat/etc/issue

The/etc directory is decentralized with the system configuration file.

/etc/issue files usually include a short description of the system or welcome information. The content is determined by the system administrator.

The results of the Execute cat/etc/issue command in Ubuntu are as follows:

[Plain]View Plaincopyprint?
    1. [Email protected]:~$ cat/etc/issue
    2. Ubuntu 11.10 \ \l
    3. [Email protected]:~$

2. View the kernel version of the command 2.1 command uname-a

Uname from Utsname, is a system call, formatted as

int uret = uname ((struct utsname) * uname_buf),

Among them, the structure pointer uname_buf mainly holds the operating system name, kernel version and hardware architecture;

struct struct utsname is defined as follows:

[Plain]View Plaincopyprint?
  1. struct Utsname {
  2. Char sysname[]; /* Operating system name (e.g., "Linux") */
  3. Char nodename[]; /* Name within "some implementation-defined
  4. Network "*/
  5. Char release[]; /* OS release (e.g., "2.6.28") */
  6. Char version[]; /* OS version */
  7. Char machine[]; /* Hardware identifier */
  8. #ifdef _gnu_source
  9. Char domainname[]; /* NIS or YP domain name */
  10. #endif
  11. };

The UTS in Utsname refers to the Universal time–sharing system (Universal Time-sharing systems).

The results of running uname-a in Ubuntu are as follows:

[Plain]View Plaincopyprint?
    1. [Email protected]:~$ uname-a
    2. Linux david-nb 3.0.0-32-generic #51-ubuntu SMP Thu Mar 15:51:26 UTC-i686 i686 i386 Gnu/linux
    3. [Email protected]:~$

The kernel version is: 3.0.0-32-generic

2.2 Command Cat/proc/version

The proc file system is a virtual file system that allows you to communicate in Linux kernel space and user space using a new method.

Unlike normal files, these virtual files are created dynamically.

/proc is very powerful, as shown below as the result of performing an interactive query on some elements in the/proc:

[Plain]View Plaincopyprint?
  1. [Email protected]:~$ Ls/proc
  2. 1     1279  1480  1512  1576  1646   1803  20    264   3081  565  902      buddyinfo    fb              loadavg       scsi            version_signature  
  3. 1001 1485 1515 1580 1649 1807 2052 265 3082 6 903 bus filesystems Locks Self Vmallocinfo
  4. 1005 1362 1487 1523 1584 1655 1815 2095 3084 7 904 cgroups FS Mdstat Slabinf o Vmstat
  5. 1006  1370  1492  1526  1585  1656  1816  21    2744  3085  754  914     cmdline      interrupts     meminfo       softirq S Zoneinfo
  6. 1007  1390  1493  1527  1589  1666  1817  216   2796  318   806  915     consoles     iomem          misc          stat
  7. 1013 1496 1539 1671 1828 217-323 837 933 Cpuinfo ioports modules swaps
  8. 1030 1409 1542 1616 1673 183 2856 PNS 838 942 crypto IRQ Mounts SYS
  9. 1073  1418  1501  1544  1617  1676  188   2391  2881  40    844  977     devices      kallsyms       mtd           sysrq-t Rigger
  10. 1079 1448 1503 1548 1619 from 847 982 device-tree Kcore mtrr SYSVIPC
  11. 1084  1453  1506  1555  1622  1711  190   2448  2998  453   848  991     diskstats    key-users      net           timer_l Ist
  12. 1456 1508 1562 1623 1712 1957 3 455 882 992 DMA kmsg pagetypeinfo timer_s Tats
  13. 1168  1457  1509  1563  1625  1776  1992  2538  3017  528   885  994     dri          kpagecount     partitions    tty
  14. 1175  1459  1510  1566  1627  1790  1997  2548  3070  531   899  acpi    driver       kpageflags     sched_debug   uptime
  15. 1464 1511 1569 1633 2 3080 540 9 Asound execdomains latency_stats schedstat version
  16. [Email protected]:~$


Where the version file stores information such as kernel versions, operating system names, and so on, the content of the uname-a is basically the same.

[Plain]View Plaincopyprint?
    1. [Email protected]:~$ cat/proc/version
    2. Linux version 3.0.0-32-generic ([email protected]) (GCC version 4.6.1 (Ubuntu/linaro 4.6.1-9ubuntu3)) #51-ubuntu SMP Thu Mar 15:51:26 UTC 2013
    3. [Email protected]:~$

Kernel version is 3.0.0-32-generic

Common Linux Operations--"continuous grooming"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.