# is a standard shell prompt for root, and only for root. For commands executed by any other user, including sudo, use $.
In general it is a bad practice to use sudo in documentation because in many distros it is not available by default. I would use su for your example. However system users have no passwords, so you need to become root first, and only after that change user to avoid prompting a password. So I would write