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
How does pipe () work?
What are the general commands in using unix os for a beginner?
What command will change your prompt to myprompt?
What is the use of find command in unix?
Is command prompt unix?
what is the advaantage of each user having its own copy of the shell?
Why is shebang used?
What is a command and examples?
Is there a way to erase all files in the current directory, including all its sub-directories, using only one command?
Describe the usage and functionality of the command rm –r * in unix?
Explain the steps that a shell follows while processing a command.
What is s and g in sed command?
What is the unix command to confirm a remote host is alive or not?
What is grep short for?
How to use grep command to list find the records of a file containing 10 different strings?