Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am putting some scripts in ~/bin and am wondering what appropriate file permissions are. To extend my question somewhat, what permissions make sense for */bin folders all over my system, and why?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Usually:

  • they are writable by the owner (root for /bin, /usr/bin, ...)

  • they executable and readable by everyone else

But your question should instead be:

  • who should be able to modify the directory?

  • who should be able to read the content and execute the binaries?

Once you answer these questions the permissions are straightforward.

An example:

$ ls -ld /bin /usr/bin /usr/local/bin ${HOME}/bin
drwxr-xr-x     8 corti  corti    272 Apr 11  2011 /Users/corti/bin
drwxr-xr-x    39 root   wheel   1326 Jul 21 19:37 /bin
drwxr-xr-x   948 root   admin  32232 Oct 10 08:36 /opt/local/bin/
drwxr-xr-x  1205 root   wheel  40970 Oct  5 09:01 /usr/bin
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.