红联Linux门户
Linux帮助

修改linux shell登陆欢迎信息

发布时间:2016-05-06 10:49:02来源:linux网站作者:junheart

Ubuntu欢迎信息保存在/etc/update-motd.d/,修改其中的文件即可修改欢迎信息:

~# ls /etc/update-motd.d/

00-header  10-help-text  90-updates-available  91-release-upgrade  98-fsck-at-reboot  98-reboot-required


修改相应文件后,执行:

~# run-parts /etc/update-motd.d/

生效。


默认欢迎信息:

Welcome to Ubuntu 14.04 LTS (GNU/Linux 3.13.0-24-generic x86_64)

* Documentation:  https://help.ubuntu.com/

260 packages can be updated.

130 updates are security updates.

You have new mail.


例如修改00-header:

[ -r /etc/lsb-release ] && . /etc/lsb-release

if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then

# Fall back to using the very slow lsb_release utility

DISTRIB_DESCRIPTION=$(lsb_release -s -d)

fi

printf "Welcome to %s (%s %s %s)\n" "My OS" "$(uname -o)" "$(uname -r)" "$(uname -m)"

cat /etc/kylin


然后新建文件/etc/kylin:

修改linux shell登陆欢迎信息


然后执行:run-parts /etc/update-motd.d/,效果:

修改linux shell登陆欢迎信息


本文永久更新地址:http://www.linuxdiyf.com/linux/20381.html