![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with GREP. | syndex | Shell Programming and Scripting | 2 | 07-11-2007 10:44 AM |
| Grep Problem | avadhani | UNIX for Dummies Questions & Answers | 8 | 06-23-2005 11:58 AM |
| grep problem | asal_email2 | UNIX for Dummies Questions & Answers | 4 | 06-22-2005 05:49 PM |
| Grep Problem | lesstjm | Shell Programming and Scripting | 2 | 10-27-2004 07:13 AM |
| Grep problem | odogbolu98 | Shell Programming and Scripting | 3 | 02-18-2003 11:53 AM |
|
|
Submit Tools | LinkBack | Thread Tools | 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.... |
| Forum Sponsor | ||
|
|
|
|||
|
\ 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. |