If you are new to CLI or not able to recall the flags of your CLI tool, you would consult man pages.
tldr is "Too Long Didn't Read" version of man pages ;) i.e it shows us the common usages of a given command.
Install it as a CLI app:$ npm install -g tldr
$ tldr sudo
execute a command as another user
- Listing of an unreadable directory:
sudo ls /usr/local/scrt
- To edit a file as user www:
sudo -u www vi /var/www/index.html
- To shutdown the machine:
sudo shutdown -r +10 "Cya soon!" - To repeat the last command as sudo
All TLDR pages are in markdown format, checkout sudo page for an example, this is a community dirven effort, so please feel free to contribute :)