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.
-
`How can I modify the write/read/execution permissions of an already-made directory in Linux shell?` -----> `chmod` and the question is off topic I think. – Kent Apr 23 '14 at 11:53
3 Answers
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
.

- 19,711
- 6
- 65
- 89
-
You guessed it right, this was indeed the problem and using **sudo make install** solved my problem. Thanks! – user3127389 Apr 23 '14 at 12:27
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
?

- 2,803
- 14
- 15
-
Erm, you do not need to be root to change directory permissions... – Markus W Mahlberg Apr 23 '14 at 12:08
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.

- 242
- 4
- 22