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
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
You can start a shell by invoking sudo -s
and then do all command you want to do.
Something like this ?
david@pcdavid:~$ cat zz
whoami
david@pcdavid:~$ sudo -i "cd /home/david; mv zz yy; chown root yy; sh yy"
root
Put those commands in a shell script and run the script with sudo.