Originally posted by: tony.evans
From the sudo manual,
http://www.sudo.ws/sudo/man/sudo.html To make a usage listing of the directories in the /home partition. Note that this runs the commands in a sub-shell to make the cd and file redirection work.
$ sudo sh -c "cd /home ; du -s * | sort -rn > USAGE"
You need to use
sudo "echo xyz >>/.profile"
to get your command to work, otherwise the redirection happens in the current shell, not as part of the sudo command.
#AIX-Forum