ls odd sorting
by Skaperen from LinuxQuestions.org on (#5KDN4)
i really didn't need any particular sorting for these 3 files but how ls sorted them caught my attention. the man page didn't explain this and i could find nothing that did in a few duckduckgo searches.
Code:lt2a/phil /home/phil 42> ls -A1 yyyy*mm*dd*hh*mm*ss*.py
yyyy_mm_dd_hhmmss_mmmuuunnn.py
yyyymmddhhmmssmmmuuunnn.py
yyyy_mm_ddThhmmss_mmmuuunnn.py
lt2a/phil /home/phil 43> ls -A1 yyyy*mm*dd*hh*mm*ss*.py|sort
yyyy_mm_ddThhmmss_mmmuuunnn.py
yyyy_mm_dd_hhmmss_mmmuuunnn.py
yyyymmddhhmmssmmmuuunnn.py
lt2a/phil /home/phil 44>there is no problem to solve because i orginally did ls to check the protection setting of these three new files. it caught my attention because the oddly named file came out sorted between the other two and the sort command produced what i expected. anyone know what search key i should hae used?
Code:lt2a/phil /home/phil 42> ls -A1 yyyy*mm*dd*hh*mm*ss*.py
yyyy_mm_dd_hhmmss_mmmuuunnn.py
yyyymmddhhmmssmmmuuunnn.py
yyyy_mm_ddThhmmss_mmmuuunnn.py
lt2a/phil /home/phil 43> ls -A1 yyyy*mm*dd*hh*mm*ss*.py|sort
yyyy_mm_ddThhmmss_mmmuuunnn.py
yyyy_mm_dd_hhmmss_mmmuuunnn.py
yyyymmddhhmmssmmmuuunnn.py
lt2a/phil /home/phil 44>there is no problem to solve because i orginally did ls to check the protection setting of these three new files. it caught my attention because the oddly named file came out sorted between the other two and the sort command produced what i expected. anyone know what search key i should hae used?