Linux – Where on a Linux file system should someone put media intended to be accessible by all user accounts

file managementlinux

If I have photos, mp3s, books and other miscellaneous stuff that I want all users to able to access from a common directory, where on a Linux file system should I put that directory? In /usr/share, or just in /usr, or create a new top-level directory instead?

Best Answer

I usually put this in /home/media, I create a media unix group that owns it with a setgid bit.

As root, or using sudo:

groupadd media
mkdir -p /home/media
chown -R root.media /home/media 
chmod g+s /home/media

Then I put each user that needs to access these data in the media group.

You could also use ACLs to manage each user's right for the directory.

You could also use /srv/media if you prefer, but I like home for shared documents. Anything in /usr is to be avoided for this unless you're talking about static files.

Related Question