Using ls or whatever, what are the require wildcards for selecting multiple file type(s)
*.pdf, *.htm, *.html
How would I seperate these or is this not allowed?
Linux wildcards questions
Moderator: General Moderators
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Untested but probably something along the lines of....
Code: Select all
ls | grep "\.\(html\?\|pdf\)$"
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Cool...d11wtq wrote:ls *.php *.html *.htmHockey wrote:Grep uses regex...I wanted to know what *wildcards* would be used...not regex
Sorry I should have clarified...my bad
Thanks anyways though
Now I wonder, how does ls execute that task...
Does it carry out each *.xxx separately and join the results after completion or does it parse the whole thing and do it all at once.
Cheers
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia