Skip to main content

Command Palette

Search for a command to run...

Grep Command in Linux/Unix

Updated
1 min read
Grep Command in Linux/Unix
U

Hi there, I am Ujjawal, programmer with a keen interest in problem-solving and developing new software that will add value to the community.

As a software developer, my goal is to build solutions that can make human life easier in any way possible.

My current skillset includes :

  1. C/C++
  2. Data Structures & Algorithms
  3. Database Management
  4. HTML5, CSS3, JavaScript.
  5. Frameworks/Libraries like React, Tailwind CSS, Bootstrap

I am always ready to learn new technologies and implement them to current solutions to make them more efficient and robust.

In Linux or Unix grep is a command which comes pre-installed with the system. if it is not present in your system you can install this by running the below command in your terminal.

$ sudo apt-get install grep

It is widely used command in day to day tasks. This command is used to search a regular expression or string in a text file. Grep stands for global regular expression print.

Syntax:

$ grep "string" file name

If you wish to search something across current directory and inside all the sub- directories you can use -r flag with this command to search recursively.

Syntax:

$ grep -r "string-name" *

More from this blog

Dev Diaries

15 posts