meaning of sudo chown -R `id -u` /data/db

情到浓时终转凉″ 提交于 2019-12-06 04:28:41

The main command is chown, which itself change the owner of the files.

-R means Recursively, means, its applied to every files in the directory

the command inside ` are execute first and then give the result to previous command

id -u is a single command seperated from chown. You can try it and see the result.

in my computer

id -u

returns

myusername

so in my computer

sudo chown -R `id -u` /data/db

is same as

sudo chown -R myusername /data/db

And now because I own that directory, I can add, edit, delete files within that folders.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!