syntax of ls --hide= and ls --ignore=
From the manual:
-I pattern
,--ignore=pattern
In directories, ignore files whose names match the shell pattern (not regular expression) pattern. As in the shell, an initial
.
in a file name does not match a wildcard at the start of pattern. Sometimes it is useful to give this option several times. For example,$ ls --ignore='.??*' --ignore='.[^.]' --ignore='#*'
The first option ignores names of length 3 or more that start with
.
, the second ignores all two-character names that start with.
except..
, and the third ignores names that start with#
.
You can use only shell glob patterns: *
matches any number of characters, ?
matches any one character, […]
matches the characters within the brackets and \
quotes the next character. The character $
stands for itself (make sure it's within single quotes or preceded by a \
to protect it from shell expansion).