我们想实现登录服务器,自动显示当前服务器的硬盘信息
其实很简单
只需要将`df -h`这行加入`/root/.bashrc`即可
`echo "df -h" >> /root/.bashrc`
>root@192.168.2.238's password:
Linux pve 4.15.18-10-pve #1 SMP PVE 4.15.18-32 (Sat, 19 Jan 2019 10:09:37 +0100) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Nov 4 00:04:48 2020 from 192.168.2.174
00:06:41 up 37 days, 1:19, 1 user, load average: 0.32, 0.32, 0.34
Filesystem Size Used Avail Use% Mounted on
udev 7.8G 0 7.8G 0% /dev
tmpfs 1.6G 166M 1.4G 11% /run
/dev/mapper/pve-root 29G 20G 7.5G 73% /
tmpfs 7.8G 28M 7.8G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
tmpfs 7.8G 6.3M 7.8G 1% /tmp