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 / thiru
Above answers allow 09:2332:19811981 input also to display.
Following may use to avoid that issue
grep -o '[0-9][0-9]:[0-9][0-9]:[0-9][0-9][0-9][0-9]' infile.txt
Is This Answer Correct ? | 44 Yes | 6 No |
Post New Answer View All Answers
Describe the usage and functionality of the command rm –r * in unix?
Explain command to display different lines that are found when compare two files?
Which command is used to restrict incoming messages?
Write a command that will find all text files in a directory such that it does not contain the word "amazing" in any form (that is, it must include the words amazing, amazing, or amazing)?
why metadb requires a seperate slice to create Solaris volume manager
What does this command do,"$more readme.txt“?
What does the md command do?
What does awk stand for?
Enlist some filename manipulation commands in unix.
What is the use of tee command?
Why is awk called awk?
Is there any method to erase all files in the current directory, along with its all sub-directories, by using only one command?
What do know about tee command and its usage?
How do I search for text in vi?
Who wrote grep?