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
Are you in or at the office?
What are reported commands?
Does cp command overwrite files?
Is there a way to erase all files in the current directory, including all its sub-directories, using only one command?
Which command can you use to find the currently running process in unix server?
What is the search command in unix?
What is ctrl d?
Write a command that will allow a unix system to shut down in 15 minutes, after which it will perform a reboot.
What is the size of time_t?
What do know about tee command?
What is the use of cut command in unix?
How do I use nslookup?
What do know about tee command and its usage?
What is “chmod” command?
Is command prompt unix?