Unix: command for sudo-mv-chown combo?
I am operating as sudo in a system where I开发者_JS百科 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
Try the install
command (options -o
, -g
and -m
).
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.
精彩评论