A case-insensitive filesystem just means that whenever the filesystem has to ask "does A refer to the same file/directory as B?" it compares the names of files/directories ignoring differences in upper/lowercase (exactly what upper/lowercase differences count depends on the filesystem—it's non-obvious once you get beyond ASCII). A case-sensitive filesystem does not ignore those differences.
A case-preserving filesystem stores file names as given. A non-case-preserving filesystem does not; it'll typically convert all letters to uppercase before storing them (theoretically, it could use lowercase, or RaNsOm NoTe case, or whatever, but AFAIK all real-world ones used uppercase).
You can put those two attributes together in any combination. I'm not sure if you can find non-case-preserving case-sensitive filesystems, but you could certainly create one. All the other combinations exist or existed in real systems, though.
So a case-preserving, case-insensitive filesystem (the most common type of case-insensitive filesystem nowadays) will store and return file names in whatever capitalization you created them or last renamed them, but when comparing two file names (to check if one exists, to open one, to delete one, etc.) it'll ignore case differences.
When you use a case-insensitive filesystem on a Unix box, various utilities will do weird things because Unix traditionally uses case-sensitive filesystems—so they're not expecting Document1
and document1
to be the same file.
In the pwd
case, what you're seeing is that it by default just outputs the path you actually used to get to the directory. So if you got there via cd DirName
, it'll use DirName
in the output. If you got there via DiRnAmE
, you'll see DiRnAmE
in the output. Bash does this by keeping track of how you got to your current directory in the $PWD
environment variable. Mainly this is for symlinks (if you cd
into a symlink, you'll see the symlink in your pwd
, even though it's actually not part of the path to your current directory). But it also gives the somewhat weird behavior you observe on case-insensitive filesystems. I suspect that pwd -P
will give you the directory name using the case stored on disk, but haven't tested.
The apropos
command reads from a cache. It's possible that recently-installed man pages are not yet referenced in that cache. Generally the cache is updated either after each package installation or in a cron job, I don't know how it's set up on CentOS.
To update the cache, run mandb
. There may be a prefered way to run it on your distribution (e.g. as a dedicated user), see if you have a system crontab entry (e.g. /etc/cron.daily/man-db
or a line in /etc/crontab
) and if you do, run that instead of calling mandb
directly.
Best Answer
Man is calling Less; the only control at the man level is choosing which options to call Less with.
Less's search case-sensitivity is controlled by two options.
-I
is in effect, then searches are case-insensitive: eithera
orA
can be used to match botha
andA
.-i
is in effect but not-I
, then searches are case-insensitive, but only if the pattern contains no uppercase letter.If you make
-I
a default option for Less, then all searches will be case-insensitive even in man pages.Man-db passes extra options to the pager via the
LESS
environment variable, which Less interprets in the same way as command line options. The setting is hard-coded at compile time and starts with-i
. (The value is"-ix8RmPm%s$PM%s$"
as of Man-db 2.6.2; theP…$
part is the prompt string.)If you don't want searches in man pages to be case-sensitive, or if you want them to be always case-insensitive, there is no way to configure this in man-db itself. You can make an alias for
man
or a wrapper script that manipulates theLESS
enviroment variable, as Man-db prepends its content to the current value if present:To turn off the
-i
option and thus make searches always case-sensitive by default in man pages:You can also hard-code a different value for
LESS
by setting theMANLESS
environment variable, but if you do that, thenman
just setsLESS
to the value ofMANLESS
, you lose the custom title line (“Manual pagefoo(42)
”) and other goodies (in particular, make sure to include-R
for bold and underline formatting).