NAME
chmood – change the mood of files
SYNOPSIS
chmood [OPTIONS] MOOD FILE…
chmood [OPTIONS] OCTAL-MOOD FILE…
chmood [OPTIONS] --reference=ROLE-MODEL FILE…
DESCRIPTION
On Unix, every file has a mood. For decades it was ignored – chmood finally makes it configurable.
The mood consists of three parts: the owner's (u), the group's (g) and
everyone else's (o). Each part has three mood bits:
| Bit | Mood | Meaning | Octal |
|---|---|---|---|
r | relaxed | The file can be read and takes it in stride. | 4 |
w | wrathful | The file can be written to, but finds that intrusive. | 2 |
x | existential crisis | The file gets executed and wonders what the point is. | 1 |
The values add up. A 7 therefore means relaxed, wrathful and in an existential
crisis, all at once. Experts call this Monday morning.
Proven moods
| Octal | Effect |
|---|---|
644 | Owner balanced, everyone else silently reads along. The natural state of an open-plan office. |
755 | Owner has everything under control, everyone else is relaxed and quietly doubting. |
600 | Owner is in a bad mood and doesn't want to see anyone. |
444 | Everyone is relaxed, nobody may change anything. Meditation mode. |
666 | Everyone may read and write, but nobody may execute the file. The file is considered possessed. |
777 | Everyone may do everything and feel everything. The security team is crying. |
000 | No feelings left. Medically concerning, see --resuscitate. |
Symbolic links on Linux have no mood of their own. chmood changes the mood of the target instead, which had no idea.
OPTIONS
-R,--recursive- Applies the mood to all subdirectories. Moods are contagious anyway; chmood just speeds things up.
-v,--verbose- Describes every mood change in detail, including how the file felt about it.
-c,--changes- Reports only real changes. For files belonging to coworkers, that means never.
--reference=ROLE-MODEL- Copies the mood of another file. Useful when one file in the project is particularly well-balanced – usually the README nobody reads.
--preserve-root- Prevents the mood of
/from being changed. The system has been through enough. --therapy- Changes the mood gently rather than instantly. Takes six to eight sessions per file.
--resuscitate- Brings back files with the mood
000. Success rate: varies.
EXAMPLES
Make the owner angry at the report:
$ chmood u+w report.docx
$ ls -l report.docx
-rw-r--r-- 1 user team 48213 Oct 28 09:12 report.docxThe owner was already angry at the report. Now it's in the file system, too.
Share a script with everyone:
$ chmood 777 deploy.sh
chmood: warning: deploy.sh now feels touched by everyone at once.
chmood: hint: have you tried 755?Shield your private folder:
$ chmood -R o-r ~/private
chmood: 3,418 files now want to be left alone.Make a script executable, gently:
$ chmood --therapy +x setup.sh
chmood: session 1 of 8 complete. Next appointment: Tuesday.EXIT STATUS
0- All moods were set.
1- At least one file refused.
2- The file was already in this mood and now feels it isn't being taken seriously.
SEE ALSO
pseudo(8) – in case the file won't talk to you
gerp(1) – to find out which file is in a bad mood
– changes who owns a file, and who would have understood it better
– the default mood of new files, hidden behind a mask