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
What is the command to compare two files in unix?
What is the unix command to confirm a remote host is alive or not?
What does grep v do?
Is there a way to erase all files in the current directory, including all its sub-directories, using only one command?
What is the pipe command?
What does the command '$ls | wc –l > file1' do?
What command is used to switching between users in unix?
How is the command '$cat file2 ' different from '$cat >file2 and >> redirection operators ?
What is awk command used for?
What is the nmap command?
What is the comma to show the space allocation of files?
What is the use of awk command in unix?
What is ctrl d?
How do you grep recursively?
What is the command to find hidden files in the current directory?