Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
MiniFoo
Dec 25, 2006

METHAMPHETAMINE

terrenblade posted:

Thank you for this, I've been using spacemonger since the 90s and knew there had to be a better way.

WinDirStat is the Windows equivalent of Disk Inventory X for macOS, by the way, which I believe came first. Not sure of any Linux variants, though.

Adbot
ADBOT LOVES YOU

RFC2324
Jun 7, 2012

http 418

MiniFoo posted:

WinDirStat is the Windows equivalent of Disk Inventory X for macOS, by the way, which I believe came first. Not sure of any Linux variants, though.

du -h --max-depth=1 is my Linux goto

18 Character Limit
Apr 6, 2007

Screw you, Abed;
I can fix this!
Nap Ghost

RFC2324 posted:

du -h --max-depth=1 is my Linux goto

find /somewhere -type d -mtime -1 | xargs du -sk | sort -rn | head -30

-print0/-0 as needed. lsof in case of deleted files still open.

Virigoth
Apr 28, 2009

Corona rules everything around me
C.R.E.A.M. get the virus
In the ICU y'all......



dogstile posted:

poo poo that pisses me off:

A co-worker got me to post next to another workers *thing* making it look like I was destroying the entire *thing*. This was meant to go to the co-worker. It went on reddit. I found it today. Not sure if I should murder him first and get the mods to take it down or get him to take it down, then murder him.

E: Got the mods to take it down and told him that if he does that again he's getting fired, because my bosses had already seen it. loving newbies man.

I'm not sure what the gently caress you are talking about here and it's pissing me off because I'm now invested.

xzzy
Mar 5, 2009

All my linux machines have this alias:

code:
alias dusk='du -sk * | sort -n'
Though I guess the max-depth option is probably a tidier way to do it.

RFC2324
Jun 7, 2012

http 418

xzzy posted:

All my linux machines have this alias:

code:
alias dusk='du -sk * | sort -n'
Though I guess the max-depth option is probably a tidier way to do it.

Not to mention the fact that my way is available on servers without needing to configure them or type something long as hell, and when you have a farm of 10k of them, many of which you aren't allowed to configure that way, comes in pretty handy.

Johnny Aztec
Jan 30, 2005

by Hand Knit

Virigoth posted:

I'm not sure what the gently caress you are talking about here and it's pissing me off because I'm now invested.

His co-worker talked him into making an office meme that OP thought was remaining internal, and the co-worker posted it to reddit.

Moey
Oct 22, 2010

I LIKE TO MOVE IT

Johnny Aztec posted:

His co-worker talked him into making an office meme that OP thought was remaining internal, and the co-worker posted it to reddit.

Well now we need to see it.

Aquila
Jan 24, 2003

RFC2324 posted:

Not to mention the fact that my way is available on servers without needing to configure them or type something long as hell, and when you have a farm of 10k of them, many of which you aren't allowed to configure that way, comes in pretty handy.

sort now has -h, so:

$ du -h -x --max-depth 1|sort -h
852K ./cg
883M ./Downloads
1.2G ./.cache
3.0G .

xzzy
Mar 5, 2009

RFC2324 posted:

Not to mention the fact that my way is available on servers without needing to configure them or type something long as hell, and when you have a farm of 10k of them, many of which you aren't allowed to configure that way, comes in pretty handy.

Well, I wouldn't want to type either version of the command by hand a billion times.

You can always define an alias on the fly and I do that a lot when investigating a node.

RFC2324
Jun 7, 2012

http 418

xzzy posted:

Well, I wouldn't want to type either version of the command by hand a billion times.

You can always define an alias on the fly and I do that a lot when investigating a node.

I use the up arrow :smug:

Or !527 if i have to do a bunch of commands between usage checks for some reason.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

RFC2324 posted:

I use the up arrow :smug:

Or !527 if i have to do a bunch of commands between usage checks for some reason.

ctrl-r is great for this once you've typed it once

RFC2324
Jun 7, 2012

http 418

Linux nerds: my long rear end command is better than your long rear end command that does the same drat thing!

18 Character Limit
Apr 6, 2007

Screw you, Abed;
I can fix this!
Nap Ghost

Aquila posted:

sort now has -h, so:

$ du -h -x --max-depth 1|sort -h
852K ./cg
883M ./Downloads
1.2G ./.cache
3.0G .

This is what I love about command-chat: learn new things.

xzzy
Mar 5, 2009

RFC2324 posted:

Linux nerds: my long rear end command is better than your long rear end command that does the same drat thing!

Windows nerds: imgur album

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

xzzy posted:

All my linux machines have this alias:

code:
alias dusk='du -sk * | sort -n'
Though I guess the max-depth option is probably a tidier way to do it.
How in the heck do you get by without the -h flag in your du command

dogstile
May 1, 2012

fucking clocks
how do they work?

Virigoth posted:

I'm not sure what the gently caress you are talking about here and it's pissing me off because I'm now invested.

Sorry I was still in mad hate mode.

A co-worker lied to me and told me that it'd be funny if a co-worker thought i was breaking a thing they'd given me to fix (personal, rather than work related). He took a picture and said he'd send it over to them. Turns out he never sent it to them, he posted the picture on reddit, posted a quote that never happened making me look like a dumb rear end in a top hat and you could quite clearly identify me in the picture.

I'm not a massive fan of dumb poo poo that I do appearing online for a variety of reasons, so i've had to yell at him for being an idiot.

xzzy
Mar 5, 2009

anthonypants posted:

How in the heck do you get by without the -h flag in your du command

Well I apparently never looked at the sort man page to know it had a -h option, and using du -h messes up the sorting.

So I just looked at the bottom of the results and did a rough conversion in my head. :v:

Virigoth
Apr 28, 2009

Corona rules everything around me
C.R.E.A.M. get the virus
In the ICU y'all......



dogstile posted:

Sorry I was still in mad hate mode.

A co-worker lied to me and told me that it'd be funny if a co-worker thought i was breaking a thing they'd given me to fix (personal, rather than work related). He took a picture and said he'd send it over to them. Turns out he never sent it to them, he posted the picture on reddit, posted a quote that never happened making me look like a dumb rear end in a top hat and you could quite clearly identify me in the picture.

I'm not a massive fan of dumb poo poo that I do appearing online for a variety of reasons, so i've had to yell at him for being an idiot.

Yeah gently caress your co-worker for doing that. :cop:

Super-NintendoUser
Jan 16, 2004

COWABUNGERDER COMPADRES
Soiled Meat

xzzy posted:

Well I apparently never looked at the sort man page to know it had a -h option, and using du -h messes up the sorting.

So I just looked at the bottom of the results and did a rough conversion in my head. :v:

'sort' now has -h which will sort the files by the human readable file size:


code:
eric@new-host-3:/var/log$ sudo du -skh *|sort -h | tail -n 10
168K	SleepWakeStacks.bin
176K	vnetlib
268K	corecaptured.log
352K	com.apple.revisiond
736K	system.log
4.3M	powermanagement
6.6M	asl
20M	com.fitbit.galileo.logs
24M	DiagnosticMessages
24M	install.log

Varkk
Apr 17, 2004

MiniFoo posted:

WinDirStat is the Windows equivalent of Disk Inventory X for macOS, by the way, which I believe came first. Not sure of any Linux variants, though.

Kdirstat was the inspiration for Windirstat according to the site.

Super Slash
Feb 20, 2006

You rang ?

dogstile posted:

I'm not a massive fan of dumb poo poo that I do appearing online for a variety of reasons, so i've had to yell at him for being an idiot.

It's a stupid thing to do for many more reasons, pretty sure in the employment law world it ticks a few of the "bad stuff" boxes.

meanieface
Mar 27, 2012

During times of universal deceit, telling the truth becomes a revolutionary act.
Had something neck-throbbing ragey happen at work. Within 24 hours, the (external) IT recruiter who knows the work friend I vented to reached out about an open position elsewhere, but more in line with what work friend is doing. I don't know whether to be :argh:, :j:, or both.

OWLS!
Sep 17, 2009

by LITERALLY AN ADMIN

RFC2324 posted:

du -h --max-depth=1 is my Linux goto

code:
du -sh
will do the same, and is easier to type has the benefit of working with bsdutils, and is hilarious when you sound it out. :eng101:

RFC2324
Jun 7, 2012

http 418

OWLS! posted:

code:
du -sh
will do the same, and is easier to type has the benefit of working with bsdutils, and is hilarious when you sound it out. :eng101:

No it doesn't. du -sh calculates the total for the current directory, and shows a single line item, du -sh * would be much closer, but still is still way uglier.

Mr. Fix It
Oct 26, 2000

💀ayyy💀


RFC2324 posted:

No it doesn't. du -sh calculates the total for the current directory, and shows a single line item, du -sh * would be much closer, but still is still way uglier.

Your command seems to miss "hidden" files that 'du -sh *' catches. I might have my globbing set to see hidden files and that might not be default, though.

RFC2324
Jun 7, 2012

http 418

Mr. Fix It posted:

Your command seems to miss "hidden" files that 'du -sh *' catches. I might have my globbing set to see hidden files and that might not be default, though.

If I want a list of files I'll use ls -alh, use du for seeing directory disk usage.

Mr. Fix It
Oct 26, 2000

💀ayyy💀


RFC2324 posted:

If I want a list of files I'll use ls -alh, use du for seeing directory disk usage.

But what if you want both at the same time?

RFC2324
Jun 7, 2012

http 418

Mr. Fix It posted:

But what if you want both at the same time?

Then I'll craft a long and obscure one liner to collect and parse the data for me.

Or just use du -sh * since that unusual situation is one time that would be superior.

Right tool for the right job, but don't use a screwdriver to hammer a nail.

Mr. Fix It
Oct 26, 2000

💀ayyy💀


RFC2324 posted:

Then I'll craft a long and obscure one liner to collect and parse the data for me.

Or just use du -sh * since that unusual situation is one time that would be superior.

Right tool for the right job, but don't use a screwdriver to hammer a nail.

Just for clarification, the ugly part is the glob *, right?

RFC2324
Jun 7, 2012

http 418

Mr. Fix It posted:

Just for clarification, the ugly part is the glob *, right?

I would agree, yes. It just makes the whole thing feel wrong to me.

22 Eargesplitten
Oct 10, 2010



I hate the Monday morning meetings here. 90% of them could be an email, and they feel like I'm back in junior high.

Actually, anything that involves interacting with my department head makes me hate this job. Imagine the stereotypical HR lady. That's her. She talks all about the company's mission statement and cultural values and polices peoples' language to a ridiculous extent. The money is great, but I don't know if I would stay here even if they offered me a permanent position.

Virigoth
Apr 28, 2009

Corona rules everything around me
C.R.E.A.M. get the virus
In the ICU y'all......



just spent my morning dealing with one of the head-scratchiest e-mail chains.
Here is the synopsis:
"Hey I was messing with the build server and I can't send jobs to Jenkins anymore did you change anything?"
"No"
"I think you broke it"
"No" repeat 3 times
"I changed the IP back to the one it had originally and it works thanks!"

This guy was asking me to update security groups in AWS and check network routes and getting huffy I wouldn't do it. I'm glad they figured it out after they CC'd in my big boss and their big boss and I kept telling them I didn't break it.... I even sent him to the change management page I keep for our Jenkins that has all the tickets for recent changes to the system.

MC Fruit Stripe
Nov 26, 2002

around and around we go
Well to be fair, anything that broke it wouldn't have been in a ticket because it would have been a "oh come on, this couldn't break anything, let's slot this one in" change.

Speaking though of changing IPs, I am shocked by how often someone in our environment changes an IP, often to another subnet entirely, and is then confused why the server stopped working. Everything is blocked unless we have an ACL for it, so you can't just change an IP and expect it to work unless you've been parsing an ASA config, yet once a month a server drops off the map and we have to explain why their application broke.

The Fool
Oct 16, 2003


I don't understand why people seem to be randomly changing IP addresses of critical servers.

Thanks Ants
May 21, 2004

#essereFerrari


Well the hackers found it on the previous location, got to keep them on their toes.

RFC2324
Jun 7, 2012

http 418

The Fool posted:

I don't understand why people seem to be randomly changing IP addresses of critical servers.

I don't understand why they are ABLE to change IP addresses of any servers, much less critical ones.

The Fool
Oct 16, 2003


MDT PE doesn't boot while bitlocker is suspended. FML.

OWLS!
Sep 17, 2009

by LITERALLY AN ADMIN

RFC2324 posted:

No it doesn't. du -sh calculates the total for the current directory, and shows a single line item, du -sh * would be much closer, but still is still way uglier.

Uuh, so does du -h --max-depth=1. At least on Debian stable:

code:
username@debian:~/Downloads$ du -h -x --max-depth=1
79M	.
user@debian:~/Downloads$ du -h -x --max-depth=1 *
40M	stuff(1).jar
40M	stuff.jar
Linux: at least our long commands are still shorter than powershell!

OWLS! fucked around with this message at 19:27 on Nov 7, 2016

Adbot
ADBOT LOVES YOU

The Fool
Oct 16, 2003


OWLS! posted:

Linux: at least our long commands are still shorter than powershell!

At least Powershell commands are human readable.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply