Copied to clipboard

sudo

`sudo` command is used to run commands as a superuser or other user on Linux systems in order to gain access permissions.

Example

  1. Run command as superuser:

    sudo command
    
  2. Run command as another user:

    sudo -u user command
    
  3. Run command with specified initial group:

    sudo -g group command
    
  4. Display a list of available sudo commands:

    sudo -l
    
  5. Run command with the specified prompt:

    sudo -p "Enter password:" command
    
  6. Recreate the user's environment:

    sudo -i
    
  7. Run command with specified user and group:

    sudo -r user:group command