![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with GREP. | syndex | Shell Programming and Scripting | 2 | 07-11-2007 01:44 PM |
| Grep Problem | avadhani | UNIX for Dummies Questions & Answers | 8 | 06-23-2005 02:58 PM |
| grep problem | asal_email2 | UNIX for Dummies Questions & Answers | 4 | 06-22-2005 08:49 PM |
| Grep Problem | lesstjm | Shell Programming and Scripting | 2 | 10-27-2004 10:13 AM |
| Grep problem | odogbolu98 | Shell Programming and Scripting | 3 | 02-18-2003 03:53 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
grep problem
just a file with thousands of filenames and I wanna get all files with the same extension, like .Z
for example.... users/123/a.Z users/424234/fafa.Z users/424234/asda.log daa/dsss/222/efesa-01002-01:00-A.Z how to solve this issue? when you make.. grep .Z file >newfile grep ".Z" file >newfile grep '.Z' file >newfile ..it finds only all files with a 'Z' in its filename. also grep -x (exact) isn't the correct solution, because 0 files. thx for any advice.... |
|
||||
|
\ is to escape the dot (.). In regular expression, a dot matches any single character. Escaping it means to treat the metacharacter (i.e. the dot in this case) literally.
$ matches the end-of-line. So, if you don't want to match something like .Za .ZIP etc. don't forget to have the $ in. |
|
||||
|
thx..
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|