【ubuntu 常用命令】如何在 ubuntu bash 命令行中查看显存、硬盘内存,以及文件大小

  1. free -h 以人类可读的方式**显示内存**使用情况,包括已使用、空闲和缓存的内存量。

    bash 复制代码
                   total        used        free      shared  buff/cache   available
    Mem:            62Gi       4.3Gi        32Gi        16Mi        25Gi        57Gi
    Swap:          2.0Gi          0B       2.0Gi
    • total: 总内存量 62Gi
    • used: 已使用的内存量 4.3Gi
    • free: 空闲的内存量 32Gi
    • buff/cache: 用于缓存的内存量 25Gi
    • available: 可用的内存量 57Gi
  2. df -h 硬盘的内存容量

    bash 复制代码
    root@username:/path/to/.cache/huggingface# df -h
    Filesystem      Size  Used Avail Use% Mounted on
    tmpfs           6.3G  2.2M  6.3G   1% /run
    /dev/nvme0n1p2  916G  737G  133G  85% /
    tmpfs            32G   12M   32G   1% /dev/shm
    tmpfs           5.0M  4.0K  5.0M   1% /run/lock
    efivarfs        128K   44K   80K  36% /sys/firmware/efi/efivars
    /dev/nvme0n1p1  511M  6.1M  505M   2% /boot/efi
    tmpfs           6.3G  140K  6.3G   1% /run/user/1000
  3. sudo du -h --max-depth=1 / | sort -hr 从根目录 /看哪些文件比较占用内存
    sudo du -h --max-depth=1 . | sort -hr 从当前目录 .看哪些文件比较占用内存

这样就非常方便清理文件啦~

相关推荐
未济3 天前
linux 配置环境变量
linux
傲世仙尊3 天前
目录即文件-Ext文件系统收尾篇
linux·c语言
_艾伦 耶格尔.3 天前
进程间通信
linux
Liuqy-053 天前
Linux IO编程——静态库、动态库
linux
彧azz3 天前
Linux 环境下 Redis 学习总结:数据类型、持久化、锁、事务、主从与缓存问题
linux·redis·笔记·学习·面试
-梅3 天前
linux(8) 软硬链接
linux·运维·服务器
AIgorithmGEEK3 天前
[Linux]线程三部曲(上):一个执行流的诞生——从操作系统一路拆到 pthread_create
linux·线程·pid
琥珀色糖3 天前
SimlpeHttp
linux·服务器
qeen873 天前
【Linux】操作系统之进程介绍(二)
linux·笔记·学习·进程
Zenova EdgeOS3 天前
Linux ss 工业边缘网络分析实战
linux·python·边缘计算·工业网关