Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Hi All, Can you please let me know how to grep for a
particular pattern in unix. I want to print the dates from
the file exp.txt. the date pattern is DD:MM:YYYY, I just
want to print all the dates from the file exp.txt.

Answer Posted / thiru

Above answers allow 09:2332:19811981 input also to display.
Following may use to avoid that issue
grep -o '[0-9][0-9]:[0-9][0-9]:[0-9][0-9][0-9][0-9]' infile.txt

Is This Answer Correct ?    44 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a command that will find all text files in a directory such that it does not contain the word "amazing" in any form (that is, it must include the words amazing, amazing, or amazing)?

1631


How do I search a whole word in vim?

1224


Explain how to use grep command to list find the records of a file containing 10 different strings?

1127


What is in grep command?

1215


What does this command do,"$more readme.txt“?

1211


Is it inbetween or in between?

1110


Name the various commands that are used for the user information in unix.

1136


Why is it called grep?

1087


What are the unix commands?

1156


What is the use of the command 'ls -x chapter[1-5]' ?

1271


Enlist some filename manipulation commands in unix.

1223


Is there any method to erase all files in the current directory, along with its all sub-directories, by using only one command?

1287


Which command is used to create a directory?

1230


Explain command to show the space allocation of files?

1170


How to use grep command to list find the records of a file containing 10 different strings?

1196