I'm trying to install Eclipse "by the book" in /opt, but when trying to access /opt, it seems that /opt directory doesn't exist in Ubuntu 14.04:
$ cd /opt/
bash: cd: /opt/: No such file or directory
$ ls -a /
. bin cdrom etc initrd.img lib lost+found mnt root sbin sys usr vmlinuz
.. boot dev home initrd.img.old lib64 media proc run srv tmp var vmlinuz.old
Why is the /opt folder missing? How to re-create one if applicable & what are the permissions to apply?
sudo mkdir --mode=755 /opt
has the advantages of being very self-documenting and working the same way on another OS or on an Ubuntu system with unusual settings, I think the simplersudo mkdir /opt
should be considered equally fine. The defaultumask
for root (as revealed bysudo -s umask
) is 0022, so a directory created by runningmkdir
as root should have permissions 0755. See the answers at What is “umask” and how does it work? for details. – Eliah Kagan Apr 09 '15 at 02:12