Toggle navigation
Log in
Sign Up
Log in
Sign Up
Appium
C
C#
C++
Docker
Go
Informatica
Java
JavaScript
Kafka
Numpy
Oracle
Pandas
PHP
Python
R
React Native
Scipy
SFTP
Tableau
Teradata
TGMC
UNIX
Forget_Code.Models.CategoryViewModel
Add a new snippet
AWK
1
Choose Category
grep in UNIX
Forget Code
UNIX
grep
The grep command searches the given file for lines containing a match to the given strings or words.
By default, grep displays the matching lines. Use grep to search for lines of text that match one or many regular expressions, and outputs only the matching lines.
Syntax:
grep 'word' filename
Example:
In /var/root/, we have a file called 1.txt.
The content in the file is "I am coming from forget code"
grep 'code' /var/root/*
Output:
/var/root/1.txt:I am coming from forget code
Tags for grep in UNIX
searching for a word in Unix
grep code
grep -v flag
grep codes unix
grep -B flag unix
Contribute to Forget Code, help others.
Add snippet