Question

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
Was it helpful?

Solution

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top