[小技巧]Linux的一些信息获取
Linux 获取 技巧 信息 一些
2023-09-14 08:57:47 时间
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, 可以选择在这里做登录提示,或者项目标志打印, 可以选择\n \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. \b : 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 \n : Insert the nodename of the machine, also known as the hostname. \o : Insert the domainname of the machine. \r : Insert the release number of the OS, eg. 1.1.9. \t : Insert the current time. \u : Insert the number of current users logged in. \U : Insert the string “1 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
相关文章
- Linux查看IP流量:简单几步获取网络数据(linux查看ip流量)
- 比较Linux中的日期设定方法(linux日期比较)
- Linux 系统快速导入数据库的技巧(linux系统数据库导入)
- Linux 日常运维:系统安全优化必背技巧(linux日常运维)
- 使用Linux命令掌握邮件发送技巧(linux中邮件命令)
- 技巧Linux重新登录指南:实用技巧介绍(linux重新登录)
- Linux快速读取文件行数的技巧(linux读取文件行数)
- Linux下GZ压缩命令实战技巧(linux压缩命令gz)
- Linux之守护王:守护线程(linux守护线程)
- 硬盘Linux挂载本地硬盘:一步一步操作指南(linux挂载本地)
- Linux异步编程:极大提升处理效率(linux异步编程)
- Linux下配置端口转发的技巧(linux配置端口转发)
- 文件Linux获取文件第一行的简便方法(linux获取第一行)
- 掌握Linux字符串匹配技巧,快速实现业务需求(linux字符串匹配)
- Linux之分支:探究其根源(linux的分支)
- 深入剖析Linux系统开发技巧,掌握操作系统开发之道(开发linux操作系统)
- 探索Linux系统下蓝牙设备的实用管理技巧(linux蓝牙设备)
- Linux进程恢复技巧(linux恢复进程)
- 「Linux软件开发教程」:学习Linux基础知识与开发技巧,掌握软件开发流程,增强编程实践能力,提高编程效率。(linux软件开发教程)
- Linux查看物理内存的方法(linux获取物理内存)
- Linux查看网卡流量:快速实现方法(linux获取网卡流量)
- 红帽 Linux:值得信赖的安全镜像(红帽linux镜像)
- 粘贴 Linux字符界面下的复制粘贴技巧(linux字符界面复制)
- Mastering Date Calculations on Linux: Tips and Tricks for Efficient Time Management(linux日期计算)
- Linux下线程池的使用及优化技巧(线程池linux)
- Linux 最快的测速命令:你必须知道的技巧(linux 测速命令)
- Linux切换终端快速技巧大全(linux 切换 终端)
- 免费体验Linux服务器的乐趣(免费的linux服务器)