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
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)?
How do I search a whole word in vim?
Explain how to use grep command to list find the records of a file containing 10 different strings?
What is in grep command?
What does this command do,"$more readme.txt“?
Is it inbetween or in between?
Name the various commands that are used for the user information in unix.
Why is it called grep?
What are the unix commands?
What is the use of the command 'ls -x chapter[1-5]' ?
Enlist some filename manipulation commands in unix.
Is there any method to erase all files in the current directory, along with its all sub-directories, by using only one command?
Which command is used to create a directory?
Explain command to show the space allocation of files?
How to use grep command to list find the records of a file containing 10 different strings?