As a real-world example for those who are curious, running mkdir twice yields errno 17, EEXIST, which is "File exists"[1]:
root@vbox:~# mkdir directory root@vbox:~# mkdir directory mkdir: cannot create directory ‘directory’: File exists
[0] https://en.wikipedia.org/wiki/Everything_is_a_file
[1] https://elixir.bootlin.com/linux/latest/source/include/uapi/...
As a real-world example for those who are curious, running mkdir twice yields errno 17, EEXIST, which is "File exists"[1]:
But sure, the fast way could be mostly right, and maybe your goal is to just get it done and not get better at these tools, in which case, sure.[0] https://en.wikipedia.org/wiki/Everything_is_a_file
[1] https://elixir.bootlin.com/linux/latest/source/include/uapi/...