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

How does the system know where one command ends and another begins?

2249


What is pipe command in unix?

1301


Which command should you use to find the remaining disk space in unix server?

1304


Describe the zip/unzip command using gzip.

1155


Which command is used to create a directory?

1162


What is the first character of the output in ls l command?

1209


What is grep and how do you use it?

1106


How do I search for a file in unix command?

1018


Can you enlist some commonly used network commands?

1108


What are bash commands?

1158


What is the command to find hidden files in the current directory?

1192


Name the general commands in using unix os for a beginner?

1156


How to display no of records in oracle using unix command?

1169


How does shebang work?

1063


What difference between cmp and diff commands?

1298