The syslog command is another option, but quite the firehose if you’re running syslog uncontrolled by grep, awk, more, or less.
#Mac log files console fill up drive update#
Once you have the log file opened with less, hit the “F” key to continuously update the log file as it updates live, making it kind of like tail -f in that it offers a constantly updating log file for easy viewing. You can also use the less command on log files, like so: There are plenty of other log files you can follow contained within /var/log but the above two are generally the most useful for troubleshooting purposes.
The tail -f command allows the specified file to be read and printed to your screen in a live stream. You can do the same with the kernel log, which is great if you’re troubleshooting hardware and connectivity issues: If you’re in this situation, or any other reason that you’d want to follow your Console system log from the command line, here’s all you need to type:
#Mac log files console fill up drive mac os x#
Yes, from time to time, problems can be so bad that even the OS X Console log can’t be opened directly! But fear not if this occurs to you, you can still track down and monitor the system log of Mac OS X by turning to the command line of the Mac. In the latter situation, unfortunately there are times when you can’t access Console either because you are remotely troubleshooting, in Single User Mode, or even because the log files have grown so large that it actually starts crashing Console.app when it’s trying to load (this has happened to me more than once). lib/mysql/my_database_dir/another_big_table.Why bother reading system logs from the terminal when there’s an OS X app to do it natively in the GUI? Well there are many reasons, perhaps because you are reviewing logs remotely with ssh, maybe you just prefer the terminal, or, maybe things are really going south. lib/mysql/my_database_dir/a_big_table.ibdĩ97M. Sudo du -aBM 2>/dev/null | sort -nr | head -n 10ġ825M. Note: Prefix with sudo to include directories that your account does not have permission to access.Įxample showing top 10 biggest files and directories in /var (including grand total).
du -aBM 2>/dev/null | sort -nr | head -n 50 | more My favorite solution uses a mix from several of these good answers. It allows to browse through the directories and show percentages of disk usage with ncurses library. It provides a fast and easy-to-use interface through famous du utility. On the "related packages" section of gt5, I found ncdu. It is possible to navigate and ascend to directories by using cursor-keys with text based browser (links, elinks, lynx etc.)
It displays what has happened since last run and displays dir size and the total percentage. This small and effective programs provides more convenient listing than the default du(1). Years have passed and disks have become larger and larger, but even on this incredibly huge harddisk era, the space seems to disappear over time. One application that looks very promising is gt5. The next command find files between 10MiB and 12MiB: find / -size +10M -size -12M -lsĪpt-cache search 'disk usage' lists some programs available for disk usage analysis. If you want to find files between a certain size, you can combine it with a "size lower than" search. The next command will list all files larger than 10MiB ( not to be confused with 10MB): find / -size +10M -ls If you just need to find large files, you can use find with the -size option.