38

On a standard filesystem, we have:

/usr/games
/usr/lib/games
/usr/local/games
/usr/share/games
/var/games
/var/lib/games

Is this a joke, or is there some history behind this? What is it for? Why do we have separate and specialized directories for something like games?

Michael Mrozek
  • 91,316
  • 38
  • 238
  • 232
uray
  • 3,830
  • 11
  • 36
  • 42

2 Answers2

34

It's just a bit of historical cruft. A long time ago, games were an optional part of the system, and might be installed by different people, so they lived in /usr/games rather than /usr/bin. Data such as high scores came to live in /var/games. As time went by, people variously put variable game data in /var/lib/games/NAME or /var/games/NAME and static game data in /usr/lib/NAME or /usr/games/lib/NAME or /usr/games/NAME or /usr/lib/games/NAME (and the same with share instead of lib for architecture-independent data). Nowadays, there isn't any compelling reason to keep games separate, it's just a matter of tradition.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
  • 2
    is this ok if I delete all `games` directories? or there will be compatibility issue? – uray Sep 06 '10 at 23:05
  • 4
    @uray: If you want to delete games, uninstall them through your distribution's package management system. – Gilles 'SO- stop being evil' Sep 07 '10 at 00:13
  • I'am messing up with something like LFS, I don't use distro and package management – uray Sep 07 '10 at 09:58
  • 1
    @uray You can delete the directories if you want. The only issue this might cause is if at some stage you try to install some game, and it doesn't check for the directory's existence. This is unlikely though, for I expect standard install tools to have such a sanity check (and a clear error message in case of trouble). – tshepang Jan 19 '11 at 08:04
5

At least partially, it's so the system can have a games group that certain users are members of, and they all have rights to execute games in the games folder

Michael Mrozek
  • 91,316
  • 38
  • 238
  • 232
  • 4
    The `games` group is not for who can play games, it's for the game administrators (they get the right to install games and manage things like high score files). In the old days, when people didn't worry about trojans, “serious” administrators would sometimes delegate game administration to volunteers (for example a student team on a university system). – Gilles 'SO- stop being evil' Sep 06 '10 at 22:37
  • I'am puzzled here, is this "games" is the "games" as in a program for entertainment & fun? or what? – uray Sep 06 '10 at 23:02
  • 1
    @Gilles Are you sure? At least on my system (Gentoo), all the executables in the games folders are owned by `root:games` and set to 750, so people not in the `games` group can't run them – Michael Mrozek Sep 06 '10 at 23:53
  • 3
    Ok, then Gentoo is doing things differently from Debian, Ubuntu, Fedora, and several non-Linux systems I've seen. By the way, on these systems, games that keep high score files are setgid `games` (mode 2755), with high score files writable by the games group only. @uray: yes, that's games as in computer games and more generally entertainment software (but games can be in `/usr/bin` like other programs too). – Gilles 'SO- stop being evil' Sep 07 '10 at 00:13
  • @uray, yes, it's "games" as in entertainment and fun stuff. There are occasionally programs that are useful but have a whimsical element, such as xcowsay, which causes a pop-up graphic of a cow with a text message for a user. – bgvaughan Oct 16 '11 at 01:31
  • @Gilles, on my Ubuntu system, I notice most of the files in /usr/games are owned by root:root, with the usual permissions. Two are owned by root:games, with the "set group ID" flag. – bgvaughan Oct 16 '11 at 01:36