Knowledge Base Ever

How to view the file size of each layer directory on Linux

2019-11-21 14:30:56

label: Linux,du, Directory file size

When we find that there are too many hard disk files to clean up, we need to know the size of each directory and its subdirectories. We can use the following command to get:
[root@Service001 var]# du -h --max-depth=1
4.0K	./opt
12K	./kerberos
104K	./spool
4.0K	./crash
8.0K	./empty
4.0K	./local
4.0K	./games
112M	./cache
138M	./lib
24K	./db
4.0K	./adm
4.0K	./nis
217M	./log
4.0K	./gopher
12K	./tmp
4.0K	./yp
4.0K	./preserve
466M	.


CentOS7 CentOS PHP Linux Python3 Python MySQL MariaDB YUM JavaScript CSS Redis MySQL8 caching_sha2_password HTML mysql_native_password PHP7 height network interface Shadowsocks-Libev unixODBC-devel error_get_last Port 80 string Aura INDENTIFIED BY password policy requirements SOCKS Web Development data Fedora Media Writer msodbcsql Redis5 SVN Deepin jemalloc SQLAlchemy absolute FuelPHP mysqlclient Shadowsocks toggle convert Error Control Operator margin PHPUnit Framework ss5.passwd at-symbol IIS password SOCKET vps daemon process Fatal Errors MongoDB4 sudoers center DATE_SUB Phalcon SQL Server 2017 WiFi .htaccess frequency conflict set_error_handler TestCase Compiling PHP Elasticsearch7.3 PHPUnit ss5.conf apr HTTP particles.js Slim Vincent Garreau daemon Failed to build these modules: _uuid MongoDB Sudo DATE_ADD ip command pg_bha.conf SQL Server width Frameworks MySQL-python scrollbar Tcp BBR Compiling Apache Elasticsearch libpython3.7m.so.1.0 PHPStorm ss5-3.8.9 Apache2.4 NodeJs show VIM CURLOPT_POSTFIELDS Failed to build these modules: _ctypes Minimal ISO substr Bluetooth INTERVAL PECL SQL Date Funcitons Wi-Fi date sub font-size root Tag Cloud CodeIgniter dual network interfaces Laravel ss5 apache httpd horiz-align node.js ShadowsocksR vertical-align CURLFille exec mb_substr PyCharm SUBDATE BarManager IntelliJIDEA PEAR SOCKS5 Proxy Server WebStorm date add find remi Tag Chrome du jQuery PHP5.5 src Apache hide nginx Shadowsocks-Python V2Ray cURL eth0 MariaDB10.4 PostgreSQL sub folder availability Install MongoDB pdo_sqlsrv SOCKS5 Web Server date File Upload mssql-tools register_shutdown_function Symfony DevExpress JetBrain php-fpm sqlsrv Zend Framework ADDDATE