【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 从当前目录 .看哪些文件比较占用内存

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

相关推荐
AlfredZhao21 小时前
Docker 容器时区不对,`timedatectl` 不存在怎么办?
linux·timezone
zzzzzz3102 天前
9K Star 炸裂开源!这个 C 语言写的代码知识图谱,把 Linux 内核索引压缩到了 3 分钟
linux·服务器·sql
XIAOHEZIcode2 天前
Linux系统鼠标偏移常见原因以及修复方案
linux·运维·游戏
A小辣椒4 天前
TShark:Wireshark CLI 功能
linux
A小辣椒4 天前
TShark:基础知识
linux
AlfredZhao4 天前
OCI 明明分配了 200G 系统盘,为什么 df 只看到 30G?
linux·oci
AlfredZhao5 天前
vi 删除指定范围的行,不用再反复按 dd
linux·vi
用户9718356334665 天前
银河麒麟 KY10 申威(SW64) 安装 nginx-1.16.1-2.p01.ky10.sw_64.rpm 详细步骤
linux
猪脚踏浪5 天前
linux 拷贝文件或目录到指定的位置
linux
摇滚侠6 天前
Linux CentOS7 rpm 安装 MySQL 5.7
linux·运维·mysql