multiple files matching - wildcards - Questions
This is a discussion on multiple files matching - wildcards - Questions ; Hello!
How to match files with 2 different extensions?
For example I would like to see only *.h and *.cc files in the output of ls.
I tried various combinations of brackets, *, | and nothing seem to work as ...
-
multiple files matching - wildcards
Hello!
How to match files with 2 different extensions?
For example I would like to see only *.h and *.cc files in the output of ls.
I tried various combinations of brackets, *, | and nothing seem to work as I want...
Anybody can help?
cheers,
mati
-
Re: multiple files matching - wildcards
marti wrote:
> Hello!
>
> How to match files with 2 different extensions?
> For example I would like to see only *.h and *.cc files in the output of ls.
> I tried various combinations of brackets, *, | and nothing seem to work as I want...
>
> Anybody can help?
>
> cheers,
> mati
ls *.h *.cc
-
Re: multiple files matching - wildcards
On Wed, 18 Feb 2004 05:38:05 -0800, marti wrote:
> Hello!
>
> How to match files with 2 different extensions? For example I would like
> to see only *.h and *.cc files in the output of ls. I tried various
> combinations of brackets, *, | and nothing seem to work as I want...
>
> Anybody can help?
>
> cheers,
> mati
ls | grep -E \.h$\|\.cc$
--
It's not that hard to understand the lesson of Viet Nam. Never never
never never defend one tyrant against another, because The worst thing
that can happen is you might win. The *Gulf* war was worse than Nam.
D. Raleigh Arnold dra@ (http://www.) openguitar.com darnold4@cox.net
-
Re: multiple files matching - wildcards
"marti" wrote in message
news:76a2c725.0402180538.72e327da@posting.google.c om
> How to match files with 2 different extensions?
> For example I would like to see only *.h and *.cc files in the output
> of ls.
> I tried various combinations of brackets, *, | and nothing seem to
> work as I want...
Match as many or as few as you like:
$ ls *.cc *.h
Also, you should keep in mind that the dot "." is just simply another legal
filename character; there are no "extensions" in *nix. An "extension" is a
MICROS~1ism, and is to a large extent the nature of the problems with that
software.
tony
--
use hotmail for any email replies
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
-
Re: multiple files matching - wildcards
ynotssor wrote:
> "marti" wrote in message
> news:76a2c725.0402180538.72e327da@posting.google.c om
>
>
>>How to match files with 2 different extensions?
>>For example I would like to see only *.h and *.cc files in the output
>>of ls.
>>I tried various combinations of brackets, *, | and nothing seem to
>>work as I want...
>
>
> Match as many or as few as you like:
>
> $ ls *.cc *.h
>
> Also, you should keep in mind that the dot "." is just simply another legal
> filename character; there are no "extensions" in *nix. An "extension" is a
> MICROS~1ism, and is to a large extent the nature of the problems with that
> software.
>
FYI: File extension existed before Bill Gates was born.
/dan