in Downloads directory, I can type something like
ls -rtl *pdf
works as expected, but if I try
ls -rtl *html
or
dir *html
I get this error:
ls: invalid option -- 'y'
Try 'ls --help' for more information.
On 07/03/2026 13.39, Woozy Song wrote:
in Downloads directory, I can type something like
ls -rtl *pdf
works as expected, but if I try
ls -rtl *html
or
dir *html
I get this error:
ls: invalid option -- 'y'
Try 'ls --help' for more information.
I would guess you have a file which name begins with '-y'
you could try: find ~/Downloads -name "*html"
or you can: ls ~/Downloads | grep html$
On Sat, 07 Mar 2026 15:32:22 +0100, J.O. Aho wrote:
On 07/03/2026 13.39, Woozy Song wrote:
in Downloads directory, I can type something like
ls -rtl *pdf
works as expected, but if I try
ls -rtl *html
or
dir *html
I get this error:
ls: invalid option -- 'y'
Try 'ls --help' for more information.
I would guess you have a file which name begins with '-y'
you could try: find ~/Downloads -name "*html"
or you can: ls ~/Downloads | grep html$
or
ls -- *html
(but programs aren't obliged to recognize the '--' option
and POSIX doesn't mandate it for ls(1), so check before using)
or--
ls ./*html
(which /does/ satisfy the POSIX requirements, and avoids
argument flag parsing by prefixing the filename expansion
values with a relative path based in the current directory)
in Downloads directory, I can type something like ls -rtl *pdf works as expected, but if I try ls -rtl *html or dir *html I get this error:
ls: invalid option -- 'y'
Try 'ls --help' for more information.
in Downloads directory, I can type something like
ls -rtl *pdf
works as expected, but if I try
ls -rtl *html
or
dir *html
I get this error:
ls: invalid option -- 'y'
Try 'ls --help' for more information.
(but programs aren't obliged to recognize the '--' option
and POSIX doesn't mandate it for ls(1), so check before using)
On Sat, 07 Mar 2026 15:32:22 +0100, J.O. Aho wrote:
On 07/03/2026 13.39, Woozy Song wrote:
in Downloads directory, I can type something like
ls -rtl *pdf
works as expected, but if I try
ls -rtl *html
or
dir *html
I get this error:
ls: invalid option -- 'y'
Try 'ls --help' for more information.
I would guess you have a file which name begins with '-y'
you could try: find ~/Downloads -name "*html"
or you can: ls ~/Downloads | grep html$
or
ls -- *html
(but programs aren't obliged to recognize the '--' option
and POSIX doesn't mandate it for ls(1), so check before using)
or
ls ./*html
(which /does/ satisfy the POSIX requirements, and avoids
argument flag parsing by prefixing the filename expansion
values with a relative path based in the current directory)
Lew Pitcher wrote:
On Sat, 07 Mar 2026 15:32:22 +0100, J.O. Aho wrote:
On 07/03/2026 13.39, Woozy Song wrote:
in Downloads directory, I can type something like
ls -rtl *pdf
works as expected, but if I try
ls -rtl *html
or
dir *html
I get this error:
ls: invalid option -- 'y'
Try 'ls --help' for more information.
I would guess you have a file which name begins with '-y'
you could try: find ~/Downloads -name "*html"
or you can: ls ~/Downloads | grep html$
or
ls -- *html
(but programs aren't obliged to recognize the '--' option
and POSIX doesn't mandate it for ls(1), so check before using)
or
ls ./*html
(which /does/ satisfy the POSIX requirements, and avoids
argument flag parsing by prefixing the filename expansion
values with a relative path based in the current directory)
but I am typing single hyphen not two
This is under Debian, bash version 5.2.37
ls version 9.7
but I am typing single hyphen not two
| Sysop: | DaiTengu |
|---|---|
| Location: | Appleton, WI |
| Users: | 1,099 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 492375:35:11 |
| Calls: | 14,106 |
| Calls today: | 2 |
| Files: | 187,124 |
| D/L today: |
1,808 files (806M bytes) |
| Messages: | 2,496,079 |