Live data from Hacker News

Htop explained

peteris.rocks

31–40 of 105 posts

Re: Htop explained

#31
post #15

I switched to macOS from Linux two weeks ago and I am starting to regret that decision. Most — if not all — the commands that I thought I had mastered after years working on Linux environments stopped working because their BSD counterparts have slightly differences that completely break everything I try to do. It is even more frustrating when I realize that I have to deactivate security features built-in the new Appl…

You should give Macports a try if you haven't already! I run it on my macbook, and it's made a world of difference. 99% of everything I use in Linux can be found in Macports, and it "just works" for the most part. You can't get kernel-specific things like strace, but they do have just about everything else. The big sell for me was being able to install the GNU versions of everything. Macports keeps everything in /opt…

[deleted]

Re: Htop explained

#32

I switched to macOS from Linux two weeks ago and I am starting to regret that decision. Most — if not all — the commands that I thought I had mastered after years working on Linux environments stopped working because their BSD counterparts have slightly differences that completely break everything I try to do. It is even more frustrating when I realize that I have to deactivate security features built-in the new Appl…

Homebrew has packages prefixed with `g`, standing for GNU, that you can install to avoid some of the BSDisms on macOS. Example: `gsed` actually parses whitespace the way I think it will; the builtin `sed` does not.

> to avoid some of the BSDisms on macOS

to be fair, you should probably call the GNU behaviour "GNUisms". The BSD behaviour is the historical POSIX behaviour. The GNU behaviour is, in a twisted sense, the result of embrace, extend and extinguish by the GNU people :-)

Re: Htop explained

#33
post #14

"You'll probably want to keep cron. But if you don't, then you should stop and disable the service. Because otherwise when trying to remove it with apt remove cron it will try to install postfix!" ...wat? Is that actually a thing?

Dependencies in debian systems which rely on "virtual" functionality can often have surprising results. At a guess removing cron removes things which depend on it - perhaps one of those is Exim. Something else "requires" an MTA, so it installs postfix instead to fill the gap.

Re: Htop explained

#34
post #3

Thank you! Great writeup! I applaud the way you approached it - figuring out every single thing about a tool. Also, I didn't know about 'od' command. Thanks again!

please do explain in 2 words the od command. I was looking on the page and there is only one od command and it is not explained. thank you

"octal dump"

(can also dump characters and hexadecimal)

Re: Htop explained

#35

I tend to use "atop" because it gives me a better overall picture of my system. But, there is something really cool about "htoo" that many users don't realise and that I hadn't realised until somebody pointed it to me recently: You can use your mouse/TrackPoint in htop to click on menu options, processes etc...

atop is way more superior than htop, specially with the log history. I just use htop when I need to check cpu usage or a particular process. But atop gives a better system status overview.

Re: Htop explained

#36
You swapped the child and parent in the printf statements here https://peteris.rocks/blog/htop/#z-defunct-zombie-process-te....

  printf("The parent process is exiting now\n");
This should read child is exiting.

  printf("The child process is sleeping now\n");
This should read parent is sleeping.

Overall, I really enjoyed the article.

Re: Htop explained

#37

> If I had two cores, my CPU usage would be 50% since my computer can run two processes at the same time. The load average of a computer with 2 cores that has a 100% CPU usage would be 2.00. If I recall correctly the CPU usage would still be 100% but could go up to 200% if both cores are fully used.

I am getting feedback that I should not be using the terms CPU usage and utilization when talking about load averages. I will update the post later.

My understanding from my Solaris days was that CPU load is the number of processes queued for CPU time over the given period. It doesn't related to usage directly at all. (Other than higher cpu speed and io through out leads to a reduction in load because tasks finish quicker)

Re: Htop explained

#38

I switched to macOS from Linux two weeks ago and I am starting to regret that decision. Most — if not all — the commands that I thought I had mastered after years working on Linux environments stopped working because their BSD counterparts have slightly differences that completely break everything I try to do. It is even more frustrating when I realize that I have to deactivate security features built-in the new Appl…

`brew install coreurils && brew install htop`

You probably also want to chmod +s htop, or it won't actually show you CPU/memory stats.
Post reply on HN