# File And Folder Permissions

**URL:** <https://community.learnlinux.tv/t/file-and-folder-permissions/516>\
**Category:** Mastering Ubuntu Server (4th Edition)\
**Created:** [May 16, 2021, 3:17am UTC](https://community.learnlinux.tv/t/file-and-folder-permissions/516 "2021-05-16T03:17:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArrowJ](https://community.learnlinux.tv/user_avatar/community.learnlinux.tv/arrowj/32/174_2.png) [@ArrowJ](https://community.learnlinux.tv/u/ArrowJ)\
**Post date:** [May 16, 2021, 3:17am UTC](https://community.learnlinux.tv/t/file-and-folder-permissions/516/1 "2021-05-16T03:17:14Z")

</div>

As relates to directories, I am a little confused. Given drw-rw---- how can a user/group view and alter the contents of a directory if they cannot go inside the directory?

---

<div class="post-metadata">

**Author:** ![Buffy](https://community.learnlinux.tv/user_avatar/community.learnlinux.tv/buffy/32/497_2.png) [@Buffy](https://community.learnlinux.tv/u/Buffy)\
**Post date:** [May 16, 2021, 3:59am UTC](https://community.learnlinux.tv/t/file-and-folder-permissions/516/2 "2021-05-16T03:59:29Z")

</div>

For directories, you need the ‘x’ permission (execute) in order to go into it.

---

<div class="post-metadata">

**Author:** ![ArrowJ](https://community.learnlinux.tv/user_avatar/community.learnlinux.tv/arrowj/32/174_2.png) [@ArrowJ](https://community.learnlinux.tv/u/ArrowJ)\
**Post date:** [May 16, 2021, 6:26am UTC](https://community.learnlinux.tv/t/file-and-folder-permissions/516/3 "2021-05-16T06:26:49Z")

</div>

So if some user “x” belonging to some group “y” has permissions drw-rw---- for some directory “z” they cannot view or alter the contents of said directory because they cannot enter the directory, or does the x bit only apply to specifically to the cd command in the shell?

---

<div class="post-metadata">

**Author:** ![Buffy](https://community.learnlinux.tv/user_avatar/community.learnlinux.tv/buffy/32/497_2.png) [@Buffy](https://community.learnlinux.tv/u/Buffy)\
**Post date:** [May 16, 2021, 2:34pm UTC](https://community.learnlinux.tv/t/file-and-folder-permissions/516/4 "2021-05-16T14:34:51Z")

</div>

Here’s the best explanation I found:

**Directory permissions**  
Permissions for directories aren’t exactly the same as they are for files. Here are some typical permissions required on directories:

- Execute permission is required for a user to cd into a directory.
- Read permission is required for a user to use a command such as ls to view the files contained in a directory.
- Execute-only permission allows a user to access the files in a directory as long as the user knows the names of the files in the directory, and the user is allowed to read the files.
- Write permission allows the user to create, delete, or modify any files or subdirectories, even if the file or subdirectory is owned by another user.

(from [Linux file and directory permissions - TechRepublic](https://www.techrepublic.com/article/linux-file-and-directory-permissions/))

---

<div class="post-metadata">

**Author:** ![BigBunny](https://community.learnlinux.tv/letter_avatar_proxy/v4/letter/b/c6cbf5/32.png) [@BigBunny](https://community.learnlinux.tv/u/BigBunny)\
**Post date:** [May 17, 2021, 12:09pm UTC](https://community.learnlinux.tv/t/file-and-folder-permissions/516/5 "2021-05-17T12:09:41Z")

</div>

As others have said the permissions for directories are different to those for files when traversing the directory. You need the execute permission to go into the directory. Jay did a very good video on permissions that should help you. This can be accessed either from YouTube or from [learnlinux.tv](http://learnlinux.tv) homepage. Usually it’s best to add users to groups and give a particular group access to that directory or file(s). Just be careful how you add remove permissions as it can affect, depending on how you do it, sub directories and files. I think Jay covered it in the same video if not it is definitely in one of his others.
