'du -hs *' on Mac failing with "du: illegal option -- n" I want a list of all the sub-directories and their total sizes. I can do it with the du -hs * command in CentOS and Ubuntu, but why doesn't it work on Mac?
This is the output I get:
MyMac:~ user$ du -hs *  
du: illegal option -- n   
usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] [-h | -k | -m | -g] [-x] [-I mask] [file ...]

As far as I know, * is a wildcard. Does macOS not support wildcards?
You probably have a file whose name begins with -n:
MyMac:~ user$ du -hs *
4.9G    Applications
1.1G    Desktop
2.2G    Documents
954M    Downloads
3.3G    Library
2.4M    Movies
7.8G    Music
 29G    Pictures
1.9G    Public
MyMac:~ user$ touch ./-none
MyMac:~ user$ du -hs *
du: illegal option -- n

Try du -hs -- *.