On an AIX server if you get a root directory ( / ) to be completely full problem and the AIX running services are unable to write their pid files and logs for example in /tmp /admin /home /var/tmp /var/log/ and rest of directory structure or the system is almost full with mounted filesystems which shows it is 90% or 95%+ full on main partition, the system is either already stuck or it is on the way to stop functiononing normally. Hence the only way to recover IBM AIX machine to a normal behavior is to clean up some files (if you can't extend the partition) or add more physical Hard drive, just as we usually do on Linux.
So How can we clean up largest files on AIX?
Lets say we want to find all files on AIX larger than 1 MB.
aix-system:/ $ find / -xdev -size 2048 -ls | sort -r +6
12579 1400 -rw-r—– 1 root security 1433534 Jun 26 2019 /etc/security/tsd/tsd.dat
9325 20361 -rw-r—– 1 root system 20848752 Nov 6 16:02 /etc/security/failedlogin
21862 7105 -rwxr-xr-x 1 root system 7274915 Aug 24 2017 /sbin/zabbix_agentd
72 7005 -rw-rw—- 1 root system 7172962 Nov 6 16:19 /audit/stream.out
24726 2810 -rw——- 1 root system 2876944 Feb 29 2012 /etc/syslog-ng/core
29314 2391 -r-xr-xr-x 1 root system 2447454 Jun 25 2019 /lpp/bos/bos.rte.filesystem/220.127.116.11.save/update.16
21844 2391 -r-xr-xr-x 1 root system 2447414 Jun 25 2019 /sbin/helpers/jfs2/logredo64
21843 2219 -r-xr-xr-x 1 root system 2271971 Jun 25 2019 /sbin/helpers/jfs2/logredo
29313 2218 -r-xr-xr-x 1 root system 2270835 Jun 25 2019 /lpp/bos/bos.rte.filesystem/18.104.22.168.save/update.15
22279 1800 -rw-r–r– 1 root system 1843200 Nov 4 08:03 /root/smit.log
12577 1399 -rw-r–r– 1 root system 1431685 Jun 26 2019 /etc/security/tsd/.tsd.bk
21837 1325 -r-xr-xr-x 1 root system 1356340 Jun 25 2019 /sbin/helpers/jfs2/fsck64
29307 1325 -r-xr-xr-x 1 root system 1356196 Jun 25 2019 /lpp/bos/bos.rte.filesystem/22.214.171.124.save/update.9
12 1262 -rw——- 1 root system 1291365 Aug 8 2011 /core
Above finds all files greater than 1 MB and sort them in reverse
order with the largest files first.
To search all files larger than 64 Megabytes under root ( / )
aix-system:/ $ find / -xdev -size +131072 -ls | sort -r +6
65139 97019 -rw-r–r– 1 root system 99347181 Mar 31 2017 /admin/archive.zip
Display 10 largest directories on system
aix-system:/ $ du -a /dir | sort -n -r | head -10
Show biggest files and directories in a directory
aix-system:/ $ du -sk * | sort -n
Below du display the size of all files and directories in the current directory with the biggest being at the bottom.
List all largest files in dir decrasingly. If a directory is matches show all sub-dirs largest files.
aix-system:/ $ ls -A . | while read name; do du -sk $name; done | sort -nr
Below ls + while loop command sorts disk usage for all files in the current directory by size, in decreasing order. If the file we suspect happens to be a directory, we can then change into that directory, and re-run the preceding command to determine what is taking up space within that directory.
Continue these steps until you find the desired file or files, at which point you can take appropriate actions.
If the bottom-most item is a directory, then cd into that directory and run the du command again. Keep drilling down until you find the biggest files on your system and get rid of them to save some space.