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 / uttamjit
You can use the below command:
grep -o '[[0-9]*:[0-9]*:[0-9]*' infile
where infile is the input file to grep command.
| Is This Answer Correct ? | 16 Yes | 12 No |
Post New Answer View All Answers
Why is shebang used?
What are the commands in UNIX to list the files in a Directory?
What does touch command do in unix?
How do I find previous commands in unix?
What do chown command do?
What does the metacharacter mean?
What is awk used for?
What do know about tee command and its usage?
What difference between cmp and diff commands?
Which command is used to kill the last background job?
What is $0 bash?
What is the use of egrep command in unix?
Differentiate cat command from more command.
What is a bash command?
What is ‘ps’ command for?