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
Does cp command overwrite files?
What will the following command do?
What is grep in bash?
What are the differences among a system call, a library function, and a unix command?
What is nr in awk command?
Give the command for finding the current date.
What's a command word?
How do I use nslookup?
What is the significance of the 'tee' command?
How does the system know where one command ends and another begins?
Which command is used to create a directory?
Name the various commands that are used for the user information in unix.
How to display no of records in oracle using unix command?
Enlist some filename manipulation commands in unix.
Which command is used to kill the last background job?