Can't create /var/mongodb/db/ directory

Hello, i’m trying to create the /var/mongodb/db/ directory with sudo but then if I “ls” the folder i can’t see the directory i just created. And what more, i can’t delete those two “\\data\\…” files. Schermata 2020-03-07 alle 16.37.04

You cannot see your directory by doing ls because it has not been created as a subdirectory of the current directory since it starts with a forward slash. But I think you already know that from

As for the removal of the files with the double backslash it is little bit more tricky. The simplest might be to run rm interactively with /bin/rm -ri *.log and answering Yes to only the one you want to remove.

1 Like

Another way is to use unlink:
unlink "\\\data\\\db\\\mongod.log"

… notice that I added an extra backslash to each part.

NB: I wonder how you got yourself into this situation?

how i got into this? mistakes during the previous lab.

Hi @michele_86234,

Can you please confirm that your issue has been resolved ?

~ Shubham

Yes, my issue has been resolved, thanks