[..]
matches any character that is listed inside.
But if the first character is ^
or !
, it matches any characters not in the specified characters.; [!_]
match characters that is not _
.
Following command lists files that whose name does not starts with _
(it should match a chracter) and contains xyz
:
ls [!_]*xyz*
2
in 2>
means file descriptor. (0 = standard input, 1 = standard output, 2 = standard error).
By appending 2> /dev/null
, error messages generated by the command will be discarded.