java欢迎词_Linux 系统登录欢迎辞

/etc 文件夹中有两个配置文件 issue 和 issue.net,用于文本设备登录系统时显示的欢迎辞的格式。

issue 是本地,不用多说,issue.net 肯定就是远程啦!

这两个文件允许使用转义序列(escape sequence),当系统遇到escape sequence的时候会自动替换成相应的信息,比如:\n 代表主机名。

完整的转移序列列表如下(此列表摘自:man agetty,因为此issue由agetty负责解释):

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. 显示硬件的等级(i386/i486/i586/i686….)

n Insert the nodename of the machine, also known as the hostname. 显示主机的网络名称

o Insert the NIS domainname of the machine. 显示 domain name

O Insert the DNS domainname of the machine.

r Insert the release number of the OS, eg. 1.1.9. 操作系统的发行版本 (类似 uname-r)

t Insert the current time. 本地端的当前时间

u Insert the number of current users logged in. 登录的用户数量

U Insert the string “1 user” or “users” whereis the number of current users logged in.

v Insert the version of the OS, eg. the build-date etc.操作系统的版本

CentOS 中,两个文件的内容一致,如下:

CentOS release 6.1 (Final)

Kernel \r on an \m

系统登录成功后的欢迎辞则是:/etc/motd,“motd”是“Message Of ToDay”的缩写,通常这个文件是空的。

在 CentOS 6.4 下,motd 文件好像不支持转义序列。

我们可以通过配置这个文件在用户登录成功之后,跟当前用户打个招呼:“Hello, welcome back!”,也可以警告一下对系统图谋不轨的“坏家伙”。

通过配置这两个文本,可以定制登录时的个性化信息,如果再配上脚本来处理,就可以实现动态的显示更多内容,比如说时间提醒、系统公告等,那就更有意思了!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值