grep command is used to display matching keyword with their specified files .
Example now in the /etc/passwd file it contain lot of user password and their user name now I like to filter name user2 in these case Linux grep command has been used.
[root@localhost ~]# vim /etc/passwd
[root@localhost ~]# grep 'user2' /etc/passwd
user2:x:504:504::/home/user2:/bin/bash
Linux grep it has the various option –i to search case insensitively
grep-n to print the number of matches line
Example
[root@localhost ~]# grep -n 'user2' /etc/passwd
40:user2:x:504:504::/home/user2:/bin/bash
-v print lines not containing patter
-Ax to include the x lines after each match
-Bx to include the x line before each match
Friday, May 14, 2010
Linux grep Command Extracting Text by Keyword
Subscribe to:
Post Comments (Atom)
Labels
3D-2D Translation
Algorithms
Batch Programming
C language
C world
C++
DBMS
Ebook
Games
JAVA
Java Programs
JNTU MATERIALS
JNTU PREVIOUS QUESTION PAPERS
JNTU SYLLABUS BOOKS
LAB MANUALS
Linux
Mobile softwares
Networking
Online Programs
PC TIPS
Software Diagrams
Software Engineering
Softwares
System Software
Visual Basic
0 comments:
Post a Comment