I know how to view the current processes on my Ubuntu machine. For example, I can leave a ping
running:
ping localhost
Then do:
$ ps -ef | grep ping
Which shows:
user1 2875 1231 0 Feb08 ? 00:00:03 /usr/libexec/gsd-housekeeping
user2 96834 43257 0 14:21 pts/4 00:00:00 ping localhost
root 96837 63560 0 14:21 pts/1 00:00:00 grep --color=auto ping
But what about the host
command? I left it running in a loop:
for i in {1..50000}; do host localhost; done
Then do:
$ps aux | grep host
But all I get is:
root 98021 63560 0 14:24 pts/1 00:00:00 grep --color=auto host
Yes, I even tried as root! Of course, I can see the name resolver, but that's always on:
$ ps -ef | grep resolv
systemd+ 1015 1 0 Feb08 ? 00:00:17 /lib/systemd/systemd-resolved
Should I not also see host
from /usr/bin/host
?
By the way, same thing with ls
. I know these commands are sort of special, kind of "built-in", but I thought they would be treated like any other process? Unlike cd
there's an actual executable. I ran strace
on it:
execve("/usr/bin/host", ["host", "localhost"], 0x7ffdf51ee518 /* 58 vars */) = 0
brk(NULL) = 0x559cc809a000
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffd20032c70) = -1 EINVAL (Invalid argument)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
...
Don't see anything that would explain it. What am I missing?! Thank you for helping to improve my understanding!