Logo

dev-resources.site

for different kinds of informations.

Running out of space on a developer's machine

Published at
12/20/2023
Categories
tip
productivity
cleanup
Author
danuw
Categories
3 categories in total
tip
open
productivity
open
cleanup
open
Author
5 person written this
danuw
open
Running out of space on a developer's machine

As developers, we often find our hard drives mysteriously filling up, slowing down our workflow.
First reflex is often to remove the waste and for developers, that includes downloaded packages that linger until we return our unused projects.
Let's explore a simple, yet powerful command-line I came across to reclaim hat precious disk space, making room for more coding and less clutter.

So I started with a 250 GB SD full

256GB full SD card

The commands we will need

Disk space

Command to get the disk space (I used an SD card smaller than my project folder until full).

 diskutil info -all
Enter fullscreen mode Exit fullscreen mode

You can also use

Remove a child folder from a directory

Looking for a command to recursively remove child node_module folder, I found the following command at https://stackoverflow.com/a/70549487/4819888 (it seems to have equivalents for Windows and Linux too)

find . -name '<folder to remove>' -type d -prune -print -exec rm -rf '{}' \;
Enter fullscreen mode Exit fullscreen mode

Cleaning up node_modules folders

find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \;
Enter fullscreen mode Exit fullscreen mode

After running this command and clearing 22 node_module folders, it went down to 76GB

70% reduction disk space removing node_module folders

Cleaning up bin folders

find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \;
Enter fullscreen mode Exit fullscreen mode

After running this command and clearing down 490 bin folders, I had a further 20 GB of additional free space.

space left after removing node_module folders and bin folders

I was thinking next we could tackle python packages but I could not find consistent naming convention though "pip" was what brought back most results. Also more on dangling docker images here. Anyway...

Conclusion

So here we are with a reduction of 78.43% of the space my projects took in no time.
What other folders shall we look to remove? Have you noticed similar savings?
What other tips might you have to share?

tip Article's
30 articles in total
Favicon
Ctrl+Alt+Arrow (Right, Left) not working on IntelliJ
Favicon
if locals == globals
Favicon
Version Control Best Practices with Git and GitHub
Favicon
Creating generic types for API (backend) responses
Favicon
Null or Nothing? Unmasking the Mystery of Parameters in Dart
Favicon
List of prompts for successful affiliate marketing
Favicon
My impressions about the book The Clean Coder ๐Ÿงน๐Ÿ“š
Favicon
Why You Should Use GraphQL Playground โฐ
Favicon
Automate WEBP To PNG With A Simple .Bat File
Favicon
In CMS Made Simple, how do you change the theme?
Favicon
A importancia de fazer testes
Favicon
Conditional Styles with CSS :has
Favicon
Do you know that 0.1 + 0.2 is not equal to 0.3?
Favicon
How to save datetime data that is relevant to multiple countries or timeย zones?
Favicon
What I've Learned About Git from Senior Colleagues (Part 1 - git stash)
Favicon
A (somewhat) deep dive into TypeScript constructor intricacies, step-by-step
Favicon
Faster Color picking in Tailwind
Favicon
Evita usar UpperCase o LowerCase C#
Favicon
#DeveloperTipOfTheWeek - Application Security
Favicon
Running out of space on a developer's machine
Favicon
Alert vs confirm in javascript
Favicon
Quick Tip: Counting up to a limit
Favicon
Quick Tip: findFile
Favicon
Time Saving Tip #2 - User Snippets in VSCode
Favicon
Notify Yourself After Completing a Long-Running Bash Process
Favicon
Time Saving Tip #1 - Use Voice Dictation
Favicon
๐Ÿš€ Unveiling the Power of OpenSearch in 202$: A Comprehensive Overview๐Ÿ˜Ž
Favicon
Quick Tip: Checking if a Number is in Range
Favicon
Building a TypeScript Simple Channel (Like Golang)
Favicon
Ubuntu Minimal Install

Featured ones: