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:
然后执行:run-parts /etc/update-motd.d/,效果: