I'm running msys2 on Windows 11:
$ uname -a
MINGW64_NT-10.0-22621 couch-potato 3.4.9.x86_64 2023-09-15 12:15 UTC x86_64 Msys
And I have it configured to use my Windows home directory (/c/Users/<username>) rather than the default home directory supplied by msys2 (/home/<username>), because unfortunately I'm using some software which requires it to be set up this way. (See sed command in step 7.)
$ cat /etc/nsswitch.conf
# Begin /etc/nsswitch.conf
passwd: files db
group: files db
db_enum: cache builtin
db_home: windows
db_shell: cygwin desc
db_gecos: cygwin desc
End /etc/nsswitch.conf
The problem is that Windows clutters up the C:\Users\<username> home directory with its own files. So when I do ls in my home directory, I see a bunch of crud such as NTUSER.DAT files.
I can mostly solve this problem with something like:
alias ls="ls --hide='ntuser.*' --hide='NTUSER.*'"
However, to do it properly, I'd want to add a bunch of other stuff to the list, like AppData, NetHood, PrintHood, etc.
And this just feels like an inelegant solution. All of the files I don't want to see are helpfully already marked with the "hidden" attribute in the Windows filesystem. So what I would like is for ls to not show files that have the "hidden" attribute. Unfortunately, looking at the command-line options for ls, there doesn't appear to be an option for doing that.
Is there a way to do this that I'm unaware of?