3 ms·
You need a separate command with options and a flag to do that in bash. No you don't; whether ls is a builtin is mostly irrelevant, but ls *1*.png does e
by userbinator 10y ago
You need a separate command with options and a flag to do that in bash.
No you don't; whether ls is a builtin is mostly irrelevant, but
ls *1*.png
does exactly what you (I assume) are saying,
dir *1*.png
which AFAIK is a new extension introduced with WinNT's command processor, since the old algorithm...
https://blogs.msdn.microsoft.com/oldnewthing/20071217-00/?p=24143 https://blogs.msdn.microsoft.com/oldnewthing/20071217-00/?p=...
...would effectively produce a pattern matching all files ending in '.png'.
- sebcat 10y agousing ls with globbing is redundant: the shell will expand * 1* .png to a list of files, which will then be passed to the argument vector of ls, looking up the files twice. You could just do echo * 1* .png. ls doesn't do glob matching. ls '*' would try to fstatat (FreeBSD) that character. EDIT: formatting
- JdeBP 10y agoThis use of the word "new" is a bit of a stretch. Consider that the "new" wildcard algorithm has been around for as long as Linux has. Possibly longer, although I'd have to check when 4DOS and 4OS2 started providing extended wildcards.