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

Does cp command overwrite files?

1130


What will the following command do?

1061


What is grep in bash?

1004


What are the differences among a system call, a library function, and a unix command?

1145


What is nr in awk command?

1127


Give the command for finding the current date.

1031


What's a command word?

1111


How do I use nslookup?

1034


What is the significance of the 'tee' command?

1133


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

2170


Which command is used to create a directory?

1089


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

1017


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

1098


Enlist some filename manipulation commands in unix.

1078


Which command is used to kill the last background job?

1289