CHOWN: What does "id -u" stand for
I am functioning to get Mongodb working on a Ubuntu web server install. In assessing the instructions I required to create a "\ information \ db" directory site in the origin drive. Whereupon I required to modify the proprietor making use of the CHOWN command as adheres to:
sudo chown `id -u` /data/db
When I release that command as it shows up in the fast start overview I receive
chown: invalid user: 'id -u'
I am new to Linux, so what I do not recognize is what the 'id -u' was intended to suggest. When I change with my customer name the command finishes simply great and also mongo runs. Can a person aid me recognize what the brief hand 'id -u' would certainly connect to a specialist Linux customer that it did not to me?
id -u publishes out your "numerical customer ID" (brief : UID) ; as you currently saw, it coincides as defining your username completely on the
chown command line. Without a doubt, the adhering to command conjurations need to all have the very same result :
sudo chown `id -u` /data/db sudo chown $USER /data/db
The reason that it did not function as anticipated has most likely to do with the quotes : they need to be backquotes (ASCII char 0x60), whereas the
chown mistake message recommends that you made use of solitary quotes (ASCII char 0x27).
You can locate a really detailed description of UNIX shell pricing estimate here.