How can I get the process with the biggest pid using
This doesn't use
That looks for the highest numbered directory inside /proc, which works because on many Unix systems there's one /proc/### directory per pid that contains information about that process.
would be POSIX.
On Linux, process ids share the same namespace as the thread ids. There, you can do:
To get the highest thread or process id number.