Re: [CentOS] listing files with spaces, using wildcard

2009-02-23 Thread Scott Silva
on 2-20-2009 5:24 AM � spake the following:
> You should use double quotes (").
> 
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing in e-mail?
> 
> 
> 
> http://www.brainyquote.com/quotes/authors/m/muhammad_ali.html
> 
> http://www.brainyquote.com/quotes/authors/e/emma_goldman.html
> 
> http://www.brainyquote.com/quotes/authors/m/michelangelo.html
> 
> 
> 
> 
> George Burns  - "I would go out with women my age, but there are no
> women my age."
> 
> On Fri, Feb 20, 2009 at 2:08 PM, bruce  > wrote:
> 
> hey...
> 
> here's one i can't see..
> 
> goat a bunch of files in different dirs.. the files might have spaces
> 
>  1foo_ aa_bb_cc.dog
>  2foo_aa__cc.dog
>  3foo_aa_bb _ccc.dog
>  4foo_aa_bb_cc.dog
>  5foo_aa_bb_cc.dog
>  6foo_aa_bb_cc.dog
> 
> i'm trying to figure out how i can do a complete list of all files with
>  *foo*dog
> 
> so i get the files with spaces and underlines...
> 
> i thought simply doing somehting like
> 
>  ls '*foo_*.dog' and surrounding the filename with single quotes would
> work.. but it doesn't.
> 
> thoughts/pointers/etc...
> 
> thanks
> 
> 
And posting a footer about the evils of top posting "while" you top post is
priceless!



-- 
MailScanner is like deodorant...
You hope everybody uses it, and
you notice quickly if they don't



signature.asc
Description: OpenPGP digital signature
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] listing files with spaces, using wildcard

2009-02-21 Thread jkinz
Edited for brevity
On Fri, Feb 20, 2009 at 05:08:07AM -0800, bruce wrote:
> goat a bunch of files in different dirs.. the files might have spaces
>  1foo_ aa_bb_cc.dog
>  2foo_aa__cc.dog
>  3foo_aa_bb _ccc.dog
>  4foo_aa_bb_cc.dog
>  5foo_aa_bb_cc.dog
>  6foo_aa_bb_cc.dog
> 
> ...how i can do a complete list of all files with >  *foo*dog
> so i get the files with spaces and underlines...
> i thought simply doing somehting like
> 
>  ls '*foo_*.dog' and surrounding the filename with single quotes would
> work.. but it doesn't.
Its not exactly clear what you wanted.

for a given dir  ls *foo*dog* gets them all. 

if you wanted to get only those with _ or spaces then
ls -1 | egrep '[ _]'  works

for a tree of dirs: find . -name "*foo*dog"gets them all

if you wanted to get only those with _ or spaces then
find . -name "*foo*dog" | egrep '[ _]'  works

Jeff Kinz

-- 
"Funniest signatures series": (found posted to a public email list)

IMPORTANT: This email remains the property of the Australian Defence
Organisation and is subject to the jurisdiction of section 70 of the CRIMES
ACT 1914.  If you have received this email in error, you are requested to
contact the sender and delete the email. 

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] listing files with spaces, using wildcard

2009-02-20 Thread bruce
hmm...

that'll work.. thanks... 


-Original Message-
From: centos-boun...@centos.org [mailto:centos-boun...@centos.org]on
Behalf Of John Doe
Sent: Friday, February 20, 2009 5:24 AM
To: CentOS mailing list
Subject: Re: [CentOS] listing files with spaces, using wildcard



From: bruce 
> goat a bunch of files in different dirs.. the files might have spaces
> 1foo_ aa_bb_cc.dog
> 2foo_aa__cc.dog
> 3foo_aa_bb _ccc.dog
> 4foo_aa_bb_cc.dog
> 5foo_aa_bb_cc.dog
> 6foo_aa_bb_cc.dog
> i'm trying to figure out how i can do a complete list of all files with
> *foo*dog
> so i get the files with spaces and underlines...
> i thought simply doing somehting like
> ls '*foo_*.dog' and surrounding the filename with single quotes would
> work.. but it doesn't.
> thoughts/pointers/etc...

If you quote, it disables the completion...

$ echo *foo_*.dog
2foo_aa__cc.dog 4foo_aa_bb_cc.dog 5foo_aa_bb_cc.dog 6foo_aa_bb_cc.dog

$ echo '*foo_*.dog'
*foo_*.dog

JD


  

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] listing files with spaces, using wildcard

2009-02-20 Thread Miguel Ángel MF
You should use double quotes (").

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?



http://www.brainyquote.com/quotes/authors/m/muhammad_ali.html

http://www.brainyquote.com/quotes/authors/e/emma_goldman.html

http://www.brainyquote.com/quotes/authors/m/michelangelo.html




George Burns  - "I would go out with women my age, but there are no women my
age."

On Fri, Feb 20, 2009 at 2:08 PM, bruce  wrote:

> hey...
>
> here's one i can't see..
>
> goat a bunch of files in different dirs.. the files might have spaces
>
>  1foo_ aa_bb_cc.dog
>  2foo_aa__cc.dog
>  3foo_aa_bb _ccc.dog
>  4foo_aa_bb_cc.dog
>  5foo_aa_bb_cc.dog
>  6foo_aa_bb_cc.dog
>
> i'm trying to figure out how i can do a complete list of all files with
>  *foo*dog
>
> so i get the files with spaces and underlines...
>
> i thought simply doing somehting like
>
>  ls '*foo_*.dog' and surrounding the filename with single quotes would
> work.. but it doesn't.
>
> thoughts/pointers/etc...
>
> thanks
>
>
> ___
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] listing files with spaces, using wildcard

2009-02-20 Thread John Doe

From: bruce 
> goat a bunch of files in different dirs.. the files might have spaces
> 1foo_ aa_bb_cc.dog
> 2foo_aa__cc.dog
> 3foo_aa_bb _ccc.dog
> 4foo_aa_bb_cc.dog
> 5foo_aa_bb_cc.dog
> 6foo_aa_bb_cc.dog
> i'm trying to figure out how i can do a complete list of all files with
> *foo*dog
> so i get the files with spaces and underlines...
> i thought simply doing somehting like
> ls '*foo_*.dog' and surrounding the filename with single quotes would
> work.. but it doesn't.
> thoughts/pointers/etc...

If you quote, it disables the completion...

$ echo *foo_*.dog
2foo_aa__cc.dog 4foo_aa_bb_cc.dog 5foo_aa_bb_cc.dog 6foo_aa_bb_cc.dog

$ echo '*foo_*.dog'
*foo_*.dog

JD


  

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] listing files with spaces, using wildcard

2009-02-20 Thread bruce
hey...

here's one i can't see..

goat a bunch of files in different dirs.. the files might have spaces

 1foo_ aa_bb_cc.dog
 2foo_aa__cc.dog
 3foo_aa_bb _ccc.dog
 4foo_aa_bb_cc.dog
 5foo_aa_bb_cc.dog
 6foo_aa_bb_cc.dog

i'm trying to figure out how i can do a complete list of all files with
 *foo*dog

so i get the files with spaces and underlines...

i thought simply doing somehting like

 ls '*foo_*.dog' and surrounding the filename with single quotes would
work.. but it doesn't.

thoughts/pointers/etc...

thanks


___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos