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_bbbb_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