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
What is used to type command?
What are the general commands in using unix os for a beginner?
What is the difference between cat command and more command?
What is the function of grep command in unix?
What does the command ' $who | sort –logfile > newfile' do?
Why is it called a shebang?
Differentiate cat command from more command.
What is updatedb?
What are the differences among a system call, a library function, and a unix command?
How is the command '$cat file2 ' different from '$cat >file2 and >> redirection operators ?
Can you explain a little bit about command substitution?
What is the command to compare two files in unix?
Explain ‘system calls’ with respect to unix commands?
What is the first character of the output in ls l command?
Explain mount and unmount command.