Question

How can I modify the write/read/execution permissions of an already-made directory in Linux shell? I need to install libsnd library but the installation gives an error that it failed to create a directory during the process.

Was it helpful?

Solution

chmod u+rwx,g=rx,o-rwx /the/directory/already/existing

Would give the user owning 'existing' all basic permissions (the plus sign says "additionally to the ones the user has now"), including the write permission, which is needed for creating directories, too. The members's of the group owning that directory will have exactly (=) the rights to read and enter this directory while the rights to read, write and enter the directory are revoked for every other user if they existed so far. (See man chmod for details).

But from the description of you problem I assume a different problem. Let me guess, you compiled something and now you are trying to install it system wide? Make sure you either switch to the root user prior to issuing make install using the su command (see man su for details) or - even better - execute sudo make install if sudo is installed (and it should be). The chmod command above will not help you in this case, either, as you would presumably not have write permissions for the directories already and existing.

OTHER TIPS

You can change the permissions (as root) using the chmod command, e.g. chmod 755 /path/to/directory.

However, your problem sounds more like an issue with the installation of your library. It is probably not a problem with the permissions of existing directories. For example, are you trying to install a library using make install, but you're installing it somewhere that would need root access and you're not running the make install command as root?

If the installation failed to create a directory, try to install libsnd in sudo mode.

toto@home: sudo *your command*

You probably install libsnd in a directory which need root access.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top