DEV Community

Cover image for [JS] This command will help you to free some disk space
Guga Cavalieri
Guga Cavalieri

Posted on

4 2

[JS] This command will help you to free some disk space

My work laptop has an small SSD Disk (128 GB) so I often receive some system notifications alerting me that my /home is running low on disk space.

After some digging I found out that many projects under my /dev folder had a node_modules folder inside eating up a bunch of space.

So I needed a magical command to remove these folders recursively and here is what I found in my first Google search result:

Clear all node_modules Directories | Mac and Linux

  1. Open your terminal.
  2. Browse to your master project directory or the top level of where you have a bunch of projects stored.
  3. Run the command: find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
  • (Optional) Create an alias (node-modules-clean)

This helped to free up 5GB on my SSD. Hope it helps you too :)

Source: rtmccormick.com

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post โ†’

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

๐Ÿ‘‹ Kindness is contagious

Please leave a โค๏ธ or a friendly comment on this post if you found it helpful!

Okay