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

Small modification required

grep -o '[0-9]*:[0-9]*:[0-9]*' infile

Is This Answer Correct ?    5 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is used to type command?

559


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

580


What do chgrp command do?

604


What does the command '$ls | wc –l > file1' do?

691


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

643






why metadb requires a seperate slice to create Solaris volume manager

2564


What is the functionality of a top command?

630


What is unix command?

594


What is the use of finger command?

607


What is a bash command?

633


Why is it called a shebang?

590


Why is it called grep?

573


Which unix command to make a new directory?

598


Explain how to use grep command to list find the records of a file containing 10 different strings?

606


What is awk used for?

628