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 / mo
#1: grep '[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]'
<filename> | more
from #1 output see which column is returned for date.
use next this command.
#1: grep '[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]'
<filename> | cut -f<from the first command> -d"<Delimeter
of file>
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Can you enlist some commonly used network commands?
How can we use grep command in unix?
How do I delete files from command prompt?
How do I use grep to search for a file?
What is grep r?
What are grep patterns?
hw will u use awk in replacing cahrs and files
What are bash commands?
Explain command to display different lines that are found when compare two files?
What is the size of time_t?
How do I run a whois command?
Explain command to show the space allocation of files?
What is grep short for?
What is {} in find command?
What is difference between grep and find command in unix?