我正在使用
如何让隐藏文件可见?
du -sch ./*
命令浏览我的系统,以找出那些可能没有任何理由积累的大型无用文件时,我发现了这个。$ du -sch ./*
du: cannot read directory ‘./drbunsen/.gvfs’: Permission denied
du: cannot read directory ‘./drbunsen/.cache/dconf’: Permission denied
18G ./drbunsen
18G total
$ cd drbunsen/
$ du -sch ./*
601M ./Desktop
20K ./Documents
598M ./Downloads
4.0K ./flash
4.0K ./Music
8.0M ./Pictures
4.0K ./Public
4.0K ./Templates
4.0K ./Ubuntu One
8.0K ./Videos
11G ./VirtualBox VMs
6.9M ./workspace
12G total
如何让隐藏文件可见?
du -sch ./.*
和du -sch ./*
得到的结果是一样的。
du -hs .[^.]* *
是用来查看所有隐藏文件的命令,不包括.
和..
,其他答案似乎都忽略了这一点。 - laggingreflexdotglob
shell选项来“修复”这个问题。我在这里使用一个子shell,以免对其他命令产生全局影响 =>(shopt -s dotglob; du -shc *)
- Zeitounator*
是做什么用的? - undefined()
是用来启动子shell的。 - undefined