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
Explain ‘system calls’ with respect to unix commands?
What is awk command used for?
What are filter commands in unix?
Give the command for finding the current date.
How do I delete files from command prompt?
What does find command return in unix?
Is there a way to erase all files in the current directory, including all its sub-directories, using only one command?
What is the use of cut command in unix?
What is {} in find command?
Can you explain a little bit about command substitution?
Explain command to show the space allocation of files?
Name the various commands that are used for the user information in unix.
Name the unix command to find how many days the server has been up.
What does this command do,"$more readme.txt“?
What is the comma to show the space allocation of files?