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 / uttamjit

You can use the below command:
grep -o '[[0-9]*:[0-9]*:[0-9]*' infile

where infile is the input file to grep command.

Is This Answer Correct ?    16 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is shebang used?

1062


What are the commands in UNIX to list the files in a Directory?

1117


What does touch command do in unix?

1354


How do I find previous commands in unix?

1137


What do chown command do?

1124


What does the metacharacter mean?

1097


What is awk used for?

1088


What do know about tee command and its usage?

1133


What difference between cmp and diff commands?

1258


Which command is used to kill the last background job?

1299


What is $0 bash?

1141


What is the use of egrep command in unix?

1133


Differentiate cat command from more command.

1091


What is a bash command?

1124


What is ‘ps’ command for?

1146