Artificial intelligent assistant

Why does ls still show the file excluded via GLOBIGNORE? File missing with `echo` but present with `ls -a`. Why? bojan@hyperion:~$ touch .ignoramus bojan@localhost:~$ ls -al | grep ignor -rw-rw-r-- 1 bojan bojan 0 Apr 19 19:05 .ignoramus bojan@localhost:~$ GLOBIGNORE=".ignoramus"; bojan@localhost:~$ echo .i* .icons bojan@localhost:~$ ls -al | grep ignor -rw-rw-r-- 1 bojan bojan 0 Apr 19 19:05 .ignoramus bojan@localhost:~$ echo $GLOBIGNORE .ignoramus The ls man says `-a` only shows hidden, doesn't mention GLOBIGNORE. -a, --all do not ignore entries starting with . ls (GNU coreutils) 8.23 GNU bash, version 4.3.42(1)-release (x86_64-pc-linux-gnu)

Setting `GLOBIGNORE` has no influence on `ls`, and the `ls` manual doesn't mention `GLOBIGNORE`, because `ls` doesn't care about `GLOBIGNORE`. It's a feature of bash only, which makes it omit some files in glob patterns.

With `echo .i*`, bash is listing the files, so `GLOBIGNORE` kicks in. With `ls -a`, `ls` is listing the files, so `GLOBIGNORE` is irrelevant.

GNU `ls` has a similar feature: you can pass a pattern to ignore as a command line option.


ls -a -I .ignoramus

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 8f57492b6cc6df8c1b2471604cf1161e