When I run
mkdir ../../bin/Release_Linux/Resources
Im getting an error
$ mkdir ../../bin/Release_Linux/Resources
mkdir: cannot create directory ‘../../bin/Release_Linux/Resources’: No such file or directory
Or just
mkdir Release_Linux/Resources
mkdir: cannot create directory ‘Release_Linux/Resources’: No such file or directory
Probably a parent directory in the path does not exist.
You can try with
See
man mkdir
If you get a
permission denied
error, you have not permissions to create a directory in the specified path.Check if you can get around the problem by modifying the group membership or ownership, so that you get the permission needed for the whole directory path involved.
Otherwise you need elevated permissions, so try with
sudo
sudodus's answer appropriately addresses how to create all directories along the given path. Alternative way would be via Python. This is especially useful if you're developing software for Ubuntu in Python and need such functionality. Calling
mkdir
as external command would add overhead of additional process and extra forking which would waste resources. Luckily Python's standard library, specificallyos
module hasmakedirs()
function:Note that such behavior also can be achieved in Perl, which is another scripting language that comes by default with Ubuntu.
I had this when the current directory literally didn't exist anymore.
I was in directory
temp
:I saw the light when the current directory was empty (not even the hidden
.
and..
existed):One directory up
temp
does exist, but it is another directory with the same name. PyCharm must have deleted and recreated the project directory when I was rolling back too much changes and undoing the rollback.