DeveloperBreeze

Linux Programming Tutorials, Guides & Best Practices

Explore 50+ expertly crafted linux tutorials, components, and code examples. Stay productive and build faster with proven implementation strategies and design patterns from DeveloperBreeze.

Tutorial
bash

How to Free Up Disk Space on Ubuntu: A Comprehensive Guide to Clearing System Cache and Unnecessary Files

#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
snap list --all | awk '/disabled/{print $1, $3}' |
    while read snapname revision; do
        snap remove "$snapname" --revision="$revision"
    done

Save the file and close the editor.

Aug 17, 2024
Read More