开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜