Re: The ls command
On Thu, Oct 30, 2025 at 07:21:37PM +0100, Nicolas George wrote:
> Van Snyder (HE12025-10-30):
> > Maybe sort it first
> > ls -- *pdf | sort | less
>
> Have you observed a difference?
>
> (Hint: ls already sorts.)
However: in this case the filename expansion (*pdf) is done by the shell and so
it is the shell which will have sorted the names.
I assume that there is not a directory with name that matches *pdf - in which
case ls will sort the names in there.
--
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256 https://www.phcomp.co.uk/
Parliament Hill Computers. Registration Information: https://www.phcomp.co.uk/Contact.html
#include <std_disclaimer.h>
Reply to: