As usage of
sudo is state of the art in Ubuntu to gain privileges and implied and obligatory in the default setup. Should code samples and sniplets in answers be prefixed with
sudo if the command requires root privileges although the necessity of privileges is clear from the context (e.g.
apt-get almost always needs privileges and I see sudo omitted in a lot of answers)? Are edits which add
sudo in such a situation welcome?
Pro for adding
sudo (iff necessary):
- code becomes copy-pastable line by line
- answers are not compatible with changes to the authentication (if in 2192 Ubuntu no longer works with
sudo, but another mechanism
A simpler form of the question: Should answers not prefixed with
sudo which don't include a hint about necessary privileges (be it in the text, with
# as prompt or however) and contain code which wouldn't work if typed into a terminal with copy-paste (e.g. https://askubuntu.com/a/436424/173287) be edited generally?