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

What are the general commands in using unix os for a beginner?

1175


Can you enlist some commonly used network commands?

1121


What is difference between grep and find command in unix?

1218


What is the search command in unix?

1094


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

1235


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

1166


What does sed command do in unix?

1207


What happens when we execute a unix command?

1150


How can we use grep command in unix?

1218


How do you grep recursively?

1115


How do I use nslookup?

1100


Is command prompt unix?

1166


What does the “echo” command do?

1162


What is unix command line?

1267


Why is grep called grep?

1308