notes on javascript, linux, and more


unix one-liners: sorted filesystem usage

i have a total storage capacity of 6gb in my laptop, so its often necessary to do a little housecleaning. the best way I've found to do this, so far, is to get a list of the directories with the highest disk usage, and sort it for easy viewing. from there, I might see some stray files I don't need anymore that I can dispose.

sudo du -c / | sort -g > sorted

"sudo du -c /" will recursively get directory disk usage for the entire filesystem. I pipe that into "sort -g" which does a generic numeric sort, and then I pipe that into a file called "sorted" which I can then look through at my convenience.

No comments:

About Me

My photo
chicago, il, United States
I'm a software engineer by profession.