bizdelnick,

# 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

<pre style="background-color:#ffffff;">
<span style="color:#323232;"># su -s /bin/bash www-data
</span><span style="color:#323232;">$ cp /var/www/html/html1 /var/www/html/html2
</span>

or

<pre style="background-color:#ffffff;">
<span style="color:#323232;"># su -s /bin/sh -c 'cp /var/www/html/html1 /var/www/html/html2' www-data
</span>

But if you are sure that sudo is installed and configured on a user’s machine, you may write

<pre style="background-color:#ffffff;">
<span style="color:#323232;">$ sudo -u www-data cp /var/www/html/html1 /var/www/html/html2
</span>
  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • [email protected]
  • aaaaaaacccccccce
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • oklahoma
  • Socialism
  • KbinCafe
  • TheResearchGuardian
  • Ask_kbincafe
  • SuperSentai
  • feritale
  • KamenRider
  • All magazines