您的当前位置:首页正文

fakeroot

来源:筏尚旅游网

fakeroot

简介

fakeroot ubuntu manpage的解释如下

fakeroot - run a command in an environment faking root privileges for file manipulation

fakeroot建立一种环境,在里边运行的命令可以以假的root权限操作文件。 读完上面这一句还是不太明白它有什么用,到底怎么用。
下面又有一句

This  is useful for allowing users to create archives (tar, ar, .deb
       etc.) with files in them with root permissions/ownership.  Without fakeroot one would need
       to  have  root privileges to create the constituent files of the archives with the correct
       permissions and ownership, and then pack them up, or  one  would  have  to  construct  the
       archives directly, without using the archiver.

fakeroot使用

fakeroot的一般用法是fakeroot – script, script是shell脚本,把需要再root权限执行的命令写在脚本里边。
参考

因篇幅问题不能全部显示,请点此查看更多更全内容