zoukankan      html  css  js  c++  java
  • [小技巧]Linux的一些信息获取

    1. Linux 系统登录之后,显示如下
    Last login: Thu Jan 1 00:00:22 UTC 1970 on ttyS0
    Linux xxx 4.1.6 #1 PREEMPT Wed Jul 19 13:15:08 CST 2017 armv7l

    那么这些信息是哪里获取到的呢,比如Jul19 13:15....

    Kernel每次编译的时间在源码的什么位置?

    include/generated/compile.h

    2. Kernel版本信息存放在源码什么位置?

    include/generated/utsrelease.h

    3. 如何定制自己的登录前后信息?

    /etc/issue, 可以选择在这里做登录提示,或者项目标志打印, 可以选择 l可以看到hostname和tty登录信息

    /etc/issue: 登录之前提示信息

    /etc/motd: 登录之后提示信息

    推荐ASCII PIC制作网站:http://patorjk.com/software/taag/#p=display&f=Graffiti&t=Type%20Something%20

    /etc/issue – escape code
    
    The issue-file (/etc/issue or the file set with the -f option) may contain certain escape codes to display the system name, date and time etc. All escape codes consist of a backslash () immediately followed by one of the letters explained below.
    
     : Insert the baudrate of the current line.
    d : Insert the current date.
    s : Insert the system name, the name of the operating system.
    l : Insert the name of the current tty line.
    m : Insert the architecture identifier of the machine, eg. i486
    
     : Insert the nodename of the machine, also known as the hostname.
    o : Insert the domainname of the machine.
    
     : Insert the release number of the OS, eg. 1.1.9.
    	 : Insert the current time.
    u : Insert the number of current users logged in.
    U : Insert the string1 user” or “ users” where is the number of current users logged in.
    v : Insert the version of the OS, eg. the build-date etc.
    4. 如何查看系统的登录信息和一些操作log?

    /var/log/auth.log

  • 相关阅读:
    代码对比软件——code compare
    IAR调试和keil调试的一点小区别
    谷访问歌助手
    X86架构的寄存器
    ant-design-pro
    js 闭包 作用域
    《三体》总结
    如何通过SQL注入盗取数据库信息
    《看见》总结
    《欲望的演化》总结
  • 原文地址:https://www.cnblogs.com/aaronLinux/p/7233618.html
Copyright © 2011-2022 走看看