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 do chgrp command do?

883


What is the command to find maximum memory taking process on the server?

931


Which unix command lists files/folders in alphabetical order?

1306


Is grep faster than awk?

785


How do I use grep to search for a file?

815


What is a command and examples?

865


What are the commands in UNIX to list the files in a Directory?

857


What are grep patterns?

808


What do know about tee command and its usage?

892


What does touch command do in unix?

1027


What do chmod command do?

870


What is ‘ps’ command for?

900


what is the advaantage of each user having its own copy of the shell?

2324


What is the function of grep command in unix?

849


What will the following command do?

852