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
Explain command to display different lines that are found when compare two files?
What does sed command do in unix?
What does the “echo” command do?
Write a command that will display files in the current directory, in a colored, long format.
Can you explain a little bit about command substitution?
Why is grep called grep?
What does grep v do?
How do I run a bash script?
When i run a programm of orphan process. Instead of getting child's parent (ppid)=1 ..i get 1400 and it varies as per system.
How can i findthe right soluion???
My pgm:
#include
How is the command '$cat file2 ' different from '$cat >file2 and >> redirection operators ?
Explain command to view process running?
why metadb requires a seperate slice to create Solaris volume manager
What does 'mkdir' command do in UNIX?
What is the search command in unix?
how to sort the content of the file based on numeric values