Grep command

Hi,
I need to list the filenames that has numeric[0-9]appended to it..
I tried, but I get the filenames that donot have numerics appended to it..

# ls | grep -E "partition-setup-and-ipl.vtcmd.[0-9]*"
partition-setup-and-ipl.vtcmd.11152012105452
partition-setup-and-ipl.vtcmd.11152012105452_orig
partition-setup-and-ipl.vtcmd_orig

I need the output only as
partition-setup-and-ipl.vtcmd.11152012105452
partition-setup-and-ipl.vtcmd.11152012105452_orig

Please help..:rolleyes:

Try like..

   ls | grep -E "partition-setup-and-ipl.vtcmd.[0-9]+" 
ls | awk '/vtcmd.[0-9]/'

Why do we even need a pipeline!

ls -1 partition-setup-and-ipl.vtcmd.[0-9]*
1 Like

You are of course right, why take extra turns :slight_smile:

It worked.. Thanks.. :b: