Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is used to type command?

1067


What are the general commands in using unix os for a beginner?

1175


What is the difference between cat command and more command?

1216


What is the function of grep command in unix?

1187


What does the command ' $who | sort –logfile > newfile' do?

1282


Why is it called a shebang?

1202


Differentiate cat command from more command.

1162


What is updatedb?

1060


What are the differences among a system call, a library function, and a unix command?

1239


How is the command '$cat file2 ' different from '$cat >file2 and >> redirection operators ?

1321


Can you explain a little bit about command substitution?

1120


What is the command to compare two files in unix?

1127


Explain ‘system calls’ with respect to unix commands?

1100


What is the first character of the output in ls l command?

1220


Explain mount and unmount command.

1231