Featured image of post Quick Tools to Manage Space Usage

Quick Tools to Manage Space Usage

Sniff out those big files

From time to time, you might need to free up disk space, but where do you start? How can you quickly locate those large files taking up valuable storage? Let’s explore some options. Spoiler alert: The first two are my top picks!

Terminal

Command to Locate Large Files

1
find / -type f -size +2000M 2>/dev/null

/: Search from the root directory (change to specific directories like /home or /var for faster results).

-type f: Search for files only.

-size +2000M: Files larger than 2000 MB.

2>/dev/null: Suppress permission denied errors.

find / -type f

Ncdu

Install ncdu:

1
sudo pacman -S ncdu

Run ncdu:

1
ncdu /

Use arrow keys to navigate

ncdu

GUI tool

If you prefer graphical tools, you can use baobab:

1
sudo pacman -S baobab

baobab

Package cache

Check cache size:

1
du -sh /var/cache/pacman/pkg

Clean package cache:

1
sudo pacman -Sc

To remove all cached packages:

1
sudo pacman -Scc

Log files

Check log sizes:

1
sudo du -sh /var/log/*

Clear logs ( use with caution !!! ):

1
sudo truncate -s 0 /var/log/filename.log

Life is a choice: reboot or be root


Built with Hugo
Theme Stack designed by Jimmy