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

Explain ‘system calls’ with respect to unix commands?

1158


What is awk command used for?

1328


What are filter commands in unix?

1261


Give the command for finding the current date.

1177


How do I delete files from command prompt?

1282


What does find command return in unix?

1203


Is there a way to erase all files in the current directory, including all its sub-directories, using only one command?

1450


What is the use of cut command in unix?

1432


What is {} in find command?

1157


Can you explain a little bit about command substitution?

1164


Explain command to show the space allocation of files?

1170


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

1136


Name the unix command to find how many days the server has been up.

1213


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

1211


What is the comma to show the space allocation of files?

1137