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
How does the system know where one command ends and another begins?
What is pipe command in unix?
Which command should you use to find the remaining disk space in unix server?
Describe the zip/unzip command using gzip.
Which command is used to create a directory?
What is the first character of the output in ls l command?
What is grep and how do you use it?
How do I search for a file in unix command?
Can you enlist some commonly used network commands?
What are bash commands?
What is the command to find hidden files in the current directory?
Name the general commands in using unix os for a beginner?
How to display no of records in oracle using unix command?
How does shebang work?
What difference between cmp and diff commands?