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 are bash commands?
What do chgrp command do?
What is the use of sed command in unix?
Is there a way to erase all files in the current directory, including all its sub-directories, using only one command?
What do chmod, chown, chgrp commands do?
What is the comma to display different lines that are found when compare two files?
What are file commands?
What command is used to switching between users in unix?
What does this command do,"$more readme.txt“?
Is grep faster than awk?
How does pipe () work?
Which command is used to create a directory?
What is the difference between cat command and more command?
Which command is used to kill the last background job?
What is ctrl d?