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
What is pipe command in unix?
What is grep and how do you use it?
Can you explain a little bit about command substitution?
How do you repeat a command in terminal?
What happens when we execute a unix command?
How do I run a whois command?
What does awk stand for?
Are you in or at the office?
What are bash commands?
what is the advaantage of each user having its own copy of the shell?
How can we use grep command in unix?
What is s and g in sed command?
How do I search for a file in unix command?
What are some command words?
What is rmdir command?