[Linux小技巧]查看文件夹大小及所属用户组

du:查询文件或文件夹的磁盘使用空间

[root@localhost mail]#  du -h --max-depth=1 /
8.0K    /media
8.0K    /mnt
58G     /data
98M     /etc
8.0K    /opt
36M     /sbin
47M     /lib64
7.9M    /tmp
13M     /boot
235M    /lib
168M    /var
39G     /home
9.6G    /usr
0       /sys
0       /proc
8.1M    /bin
8.0K    /misc
530M    /root
8.0K    /srv
108K    /dev
16K     /lost+found
8.0K    /selinux
108G    /

这样查linux下文件夹占用磁盘空间过多就一目了然了。

ls-lh 查询linux 下文件夹/文件用户所属组及权限

[root@localhost mail]# cd /
[root@localhost /]# ls -lh
total 252K
drwxr-xr-x   2 root root 4.0K Apr 20 04:02 bin
drwxr-xr-x   3 root root 4.0K Apr 11 11:50 boot
drwxr-xr-x   6 root root 4.0K Apr 16 20:35 data
drwxr-xr-x  11 root root 3.5K Jun 25 14:49 dev
drwxr-xr-x  85 root root  12K Jun 25 14:48 etc
drwxr-xr-x  10 root root 4.0K Jun 25 00:17 home
drwxr-xr-x  11 root root 4.0K Apr 11 12:49 lib
drwxr-xr-x   8 root root  12K May 10 17:49 lib64
drwx------   2 root root  16K Apr 11 11:21 lost+found
drwxr-xr-x   2 root root 4.0K Jan 27  2010 media
drwxr-xr-x   2 root root 4.0K Mar 31  2010 misc
drwxr-xr-x   2 root root 4.0K Jan 27  2010 mnt
drwxr-xr-x   2 root root 4.0K Jan 27  2010 opt
dr-xr-xr-x 145 root root    0 Jun 25 14:47 proc
drwxr-x---   6 root root 4.0K May 30 22:12 root
drwxr-xr-x   2 root root  12K Apr 20 04:02 sbin
drwxr-xr-x   2 root root 4.0K Apr 11 11:23 selinux
drwxr-xr-x   2 root root 4.0K Jan 27  2010 srv
drwxr-xr-x  11 root root    0 Jun 25 14:47 sys
drwxrwxrwt   5 root root  72K Jun 25 16:20 tmp
drwxr-xr-x  18 root root 4.0K Apr 11 13:09 usr
drwxr-xr-x  21 root root 4.0K Apr 11 16:30 var
此条目发表在 Linux服务器 分类目录,贴了 , 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>