←back to thread

466 points CoolCold | 1 comments | | HN request time: 0.201s | source
Show context
ccorcos ◴[] No.40220178[source]
Can someone explain what this is / how it works to someone who has done a considerable amount of programming but lacks this kind of operating system level knowledge?

I was under the impression that ‘sudo’ was baked into the entire system. Like ‘cd’ or ‘ps’. How exactly can you just swap out sudo? Does that involve swapping out chmod as well?

replies(8): >>40220205 #>>40220206 #>>40220219 #>>40220224 #>>40220238 #>>40220277 #>>40220342 #>>40222121 #
apexalpha ◴[] No.40220205[source]
sudo, and even cd and ps you mention are simply binaries that come shipped with your distro / OS.

They, like explorer.exe on Windows, are an essential part of that OS with special privileges and roles but they are not part of the kernel, they are still simply programs. It is not developed by the people who develop the Linux kernel.

There are other Sudo alternatives such as DoAs already.

replies(1): >>40220256 #
1. csande17 ◴[] No.40220256[source]
While some systems include a "cd" binary, it's basically useless since it just changes its own working directory and then exits.

Instead, "cd" commands are generally parsed and executed by your shell (/bin/sh or similar) directly so that the shell's working directory gets changed and you can run subsequent commands in the new location.

"ps" on the other hand is indeed just a normal program. Usually it reads files in /proc to figure out which processes are running.