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 command will change your prompt to myprompt?

700


How do I search for a file in unix command?

546


What does this command do? Cat food 1 > kitty

975


Explain command to view process running?

611


Is it inbetween or in between?

580






What do chmod command do?

602


Is grep faster than awk?

557


What does awk stand for?

605


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

797


Enumerate some of the most commonly used network commands in unix?

616


Which command can you use to find the currently running process in unix server?

586


What does sed command do in unix?

560


Why is shebang used?

595


How is the command '$cat file2 ' different from '$cat >file2 and >> redirection operators ?

759


Write a command to kill the last background job?

618