zoukankan      html  css  js  c++  java
  • linux命令-du查看占用磁盘空间大小

    格式

    df -h 查看磁盘分区情况

    du /etc 目录文件大小都列出来 单位是k最后一行是总和

    du -m 单位是m 小于1m写成1m

    du -h 单位人性化显示k/m

    du -sh /etc 查看指点目录/文件大小

    //////////////////////////////////////////////////////////////////////////////////////

    du查看和ls查看区别

    [root@wangshaojun ~]# du -sh /etc/init.d/iptables
    12K /etc/init.d/iptables                         
    [root@wangshaojun ~]# ls -lh  /etc/init.d/iptables
    -rwxr-xr-x. 1 root root 11K 7月  24 10:08 /etc/init.d/iptables ///////du-12k ls-11k

    转换成k为单位

    [root@wangshaojun ~]# ls -lb  /etc/init.d/iptables
    -rwxr-xr-x. 1 root root 11048 7月  24 10:08 /etc/init.d/iptables
    [root@wangshaojun ~]# du -sb /etc/init.d/iptables
    11048 /etc/init.d/iptables   ////////ls-11048b  du-11048b 一样的

    ////////////////////////////////////////////////////////////////////////////////////////////////////

    [root@wangshaojun ~]# touch /tmp/1.txt
    [root@wangshaojun ~]# echo "12">>/tmp/1.txt
    [root@wangshaojun ~]# ll /tmp/1.txt
    -rw-r--r--. 1 root root 3 11月  6 19:35 /tmp/1.txt   /////真实大小
    [root@wangshaojun ~]# du -sh /tmp/1.txt
    4.0K /tmp/1.txt   /////占用磁盘块的大小

  • 相关阅读:
    会计基础-资本与资本公积核算
    FORM 基本控件2
    EBS form的一些知识
    EBS功能安全性基本原理
    主物料界面数据来源
    organization --form 表单中organization 数据来源
    form 相关
    jar/war/ear文件的区别
    ORACLE判别字段是否包含中文
    亲测可用:SecureCRT 7 注册码/序列号
  • 原文地址:https://www.cnblogs.com/wangshaojun/p/4942142.html
Copyright © 2011-2022 走看看