用编辑器打开文件 ``` # vim /etc/motd ``` 输入需要提示的信息 ```shell ************************************************************** * * * .=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-. * * | ______ | * * | .-" "-. | * * | / \ | * * | _ | | _ | * * | ( \ |, .-. .-. ,| / ) | * * | > "=._ | )(__/ \__)( | _.=" < | * * | (_/"=._"=._ |/ /\ \| _.="_.="\_) | * * | "=._"(_ ^^ _)"_.=" | * * | "=\__|IIIIII|__/=" | * * | _.="| \IIIIII/ |"=._ | * * | _ _.="_.="\ /"=._"=._ _ | * * | ( \_.="_.=" `--------` "=._"=._/ ) | * * | > _.=" "=._ < | * * | (_/ \_) | * * | | * * '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=' * * * * LASCIATE OGNI SPERANZA, VOI CH'ENTRATE * ************************************************************** ``` 然后修改配置文件可以每次登陆服务器自动显示磁盘情况 ``` # vim /root/.bash_profile ``` 再结尾添加 ```shell echo '==========================================================' cat /etc/redhat-release echo '==========================================================' df -lh ``` 最终为 ```shell # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH echo '==========================================================' cat /etc/redhat-release echo '==========================================================' df -lh ``` 先退出服务器,然后重新登陆,显示如下: ```shell Last login: Wed Mar 21 22:54:28 2018 from 192.168.20.50 ************************************************************** * * * .=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-. * * | ______ | * * | .-" "-. | * * | / \ | * * | _ | | _ | * * | ( \ |, .-. .-. ,| / ) | * * | > "=._ | )(__/ \__)( | _.=" < | * * | (_/"=._"=._ |/ /\ \| _.="_.="\_) | * * | "=._"(_ ^^ _)"_.=" | * * | "=\__|IIIIII|__/=" | * * | _.="| \IIIIII/ |"=._ | * * | _ _.="_.="\ /"=._"=._ _ | * * | ( \_.="_.=" `--------` "=._"=._/ ) | * * | > _.=" "=._ < | * * | (_/ \_) | * * | | * * '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=' * * * * LASCIATE OGNI SPERANZA, VOI CH'ENTRATE * ************************************************************** ========================================================== CentOS Linux release 7.4.1708 (Core) ========================================================== 文件系统 容量 已用 可用 已用% 挂载点 /dev/sda3 10G 3.9G 6.2G 39% / devtmpfs 978M 0 978M 0% /dev tmpfs 993M 0 993M 0% /dev/shm tmpfs 993M 9.1M 984M 1% /run tmpfs 993M 0 993M 0% /sys/fs/cgroup /dev/sda1 197M 136M 61M 70% /boot tmpfs 199M 0 199M 0% /run/user/0 最后修改:2019 年 02 月 20 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 如果觉得我的文章对你有用,请随意赞赏