Check space usage in ubuntu

Check space usage in ubuntu

ls

Simply check the space occupied by the current file;

ls -lah

fdisk

View partition status

fdisk -l 

df

Check the disk space usage of the system

df -lah
df -h
df -TH

du

Check the space used by a directory

du -sh       需要先进入该目录,或者后面加上路径
du -sh 路径

# 查看某目录下占用空间最多的文件或目录。取前10个。需要先进入该目录下。
du -cks * | sort -rn | head -n 10

# 查看文件夹最大深度2
du -h --max-depth=2 
du -h --max-depth=2 /home/forjie/project

reference

@misc{BibEntry2023Jul,
title = { {ubuntu View occupied file space{ _ \_ _ }Ubuntu View the space occupied by a folder{ _ \_ _ }It’s July {\textasciitilde}’s blog-CSDN blog}},
year = {2023},
month = jul,
urldate = {2023-07-04},
language = {chinese},
note = {[Online; accessed 4. Jul. 2023]},
url = {https://blog.csdn.net/qq_51668174/article/details/129338213}
}

Guess you like

Origin blog.csdn.net/orDream/article/details/131538839