How To Make A Directory Public In Linux?

Linux provides permissions in order to allow or deny access to a directory. By default, a directory is only accessible by its owner after the directory creation. But sometimes we may want to make a directory public which means everyone can access, read, write and execute the directory content. In this tutorial, we examine how to make a directory public with different attributes.

Make A Directory Public for Read, Writing, and Execute

The chmod command is used to change directory permissions for read, write and execute. We can use the permission 777 in order to make a directory public. This means all users can read, write and execute the directory content without any restriction.

$ chmod -R 777 /mydirectory

Make A Directory Public for Reading

We can make a directory public for only reading the content. This means content can be read by all users but can not be written or executed.

$ chmod -R a+r /mydirectory

Make A Directory Public for Writing

We can make a directory public for writing. All users can write into the directory for existing and new files.

$ chmod -R a+w /mydirectory

Leave a Comment