tags:

views:

98

answers:

4

I am operating as sudo in a system where I mv a great amount of files and dirs to and fro. Is there a command for the combo?

$ sudo -i; # mv hello /home/other; # chown -R other:other /home/other/hello
A: 

You can start a shell by invoking sudo -s and then do all command you want to do.

aioobe
+6  A: 

Try the install command (options -o, -g and -m).

Philipp
+1. Didn't knew that this existed. Exactly what the OP asked for.
ereOn
A: 

Something like this ?

david@pcdavid:~$ cat zz
whoami
david@pcdavid:~$ sudo -i "cd /home/david; mv zz yy; chown root yy; sh yy"
root
David V.
A: 

Put those commands in a shell script and run the script with sudo.

phantom-99w