Originally Posted by Matir
Any chance there's a file name starting with a dash containing an 'e'? Try "ls -- *txt*".
I've Never seen this before. I've used -FileName (hyphen FileName) for years to get a info or important file to list first... Wow.
I was exhausted. My next step was to compile utils from source.
In My Case: I had a file named '-2016.11.26-whatever.txt' - it was important info from that date. I didn't connect the --'2' error with file names and was getting:
ls: invalid option -- '2'
P.S. - weird thing is, I didn't get the error in terminal as root, working on same directory / files using same options ls *.txt
Only difference is for root:
# echo $LS_OPTIONS there is a '-A' where my user does not have the '-A' - rest is the same