在Ubuntu系统中,你可以使用以下几种方法来查看swap的状态:
free
命令Ctrl + Alt + T
)。free -h
-h
选项以人类可读的格式显示数据。swapon
命令swapon --show
/proc/swaps
文件cat /proc/swaps
top
或htop
命令top
htop
(如果尚未安装):sudo apt install htop
htop
top
或htop
的输出中,你可以看到内存和交换空间的使用情况。/etc/fstab
文件cat /etc/fstab
通过以上方法,你可以轻松地查看Ubuntu系统中swap的状态和使用情况。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:ubuntu swap如何监控其状态