3 ms·
- List dirs and file count, to find dir with high file count. for i in /home/*; do echo $i; find $i | wc -l; done for i in /*; do echo $i; find $i |
by ww520 4y ago
- List dirs and file count, to find dir with high file count.
for i in /home/*; do echo $i; find $i | wc -l; done
for i in /*; do echo $i; find $i | wc -l; done
- Report space usage of the top level subdirectories.
du -h --max-depth=2
- Report space summary only, no directory output.
du -s -h
- Find out which device a directory is in.
df /tmp
df /home
- Print of tree of directories
tree .
- Disk
fdisk -l, list disk partitions
lsblk, show a tree of disks, partitions, and lvm volumes
lsblk -d, show physical devices
lsblk -io KNAME,TYPE,SIZE,MODEL, name/type/size/model
- carom 4y agoI very often use the while pattern. Where ls -1 and echo $line can be swapped out. ls -1 | while read line; do echo $line; done