Forum Discussion
How to remove junk files on mac and free up storage space?
This is a great way to clear junk file for mac using only built-in Terminal commands, no extra software required. It essentially lets you remove outdated system logs that accumulate over time, allowing you to free up hundreds of megabytes to gigabytes of storage space safely.
Usage Guide: Open the Terminal app on your Mac.
First, run this command to check the total size of the system log folder:
du -sh /private/var/log/
Next, execute these commands to clear old compressed logs and expired log archives:
sudo rm -rf /private/var/log/*.gz
sudo rm -rf /private/var/log/*.log.*This method requires no third-party software installation and swiftly helps you clear junk file for mac by removing unnecessary system log files, effectively reclaiming disk space.
It is particularly useful for users comfortable with Terminal commands, performing quick system maintenance, or freeing up space after long-term use of macOS.