As I was trying to reverse engineer the ls command, I came upon an interesting behavior. When I make 3 files,
fooqa.png, ls sorts them as
fooqa.png. I also tried it using the .gif extension and it seems to be that it happens when p and q are replaced by the first letter of the extension and the next letter in the alphabet; so in the case of .gif it would be g and h. (
Why does it order the output this way?