• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

find command to search keyword in files recursively in linux

June 19, 2013 by Sharad Chhetri Leave a Comment

find command to search keyword in files recursively in linux
Find command is one of the system command which is useful to search files and directory.
It has many used and you can modify your search by using -exec flag. Here I am using exec with grep command.

By below given command you can find the keyword in files in linux system.
(Replace the “keyword” with your searching word)

Here below given flags with grep command have these features
-l will only show file name
-w will look for exact same keyword

Find more keywords by typing command “grep –help”


find / -type f -exec grep "keyword" {} +

or 

find / -type f -exec grep -l "keyword" {} +

eg.

For Exact Pattern of keyword

find / -type f -exec grep -w "keyword" {} +

OR 

find / -type f -exec grep -w -l "keyword" {} +

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. Search Keyword In Man Page Like We Search In vi / vim Editor
  2. rsync all files,hidden files,symlinks,hardlinks to remotes Linux Server
  3. search keyword in file with line number using grep command
  4. Search keyword in all available man pages – man command
  5. awk command to search keyword or strings in file
  6. linux command to list the files from rpm package without extracting
  7. How to use grep command to get fixed pattern or exact keyword
  8. How to rename and move the directory and files in linux
  9. list files and directories by 4 commands in linux
  10. Extract single and selected files from RPM package on Linux

Filed Under: Linux, Tips And Tricks Tagged With: find

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Linux Commands

man command not found in CentOS and Red Hat

How to install libxml2 and libxslt packages on CentOS 6.5

sed : find the pattern (keyword) and delete the line from file

awk command to search keyword or strings in file

How To Find Absolute Full Path Of Command On Linux / Unix : which command

cat,sed and awk commands to display file contents

There are unfinished transactions remaining. You might consider running yum-complete-transaction

Explore 70+ Articles On Linux Commands

Always Useful Tips And Tricks

AttributeError: ‘WSGIRequest’ object has no attribute ‘session’ Django python web framework

Change default editor of crontab in Ubuntu

send email after mysql backup through bash script in simple way

Recover Linux Grub Password in linux rescue mode CentOS/Red Hat

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

Run the script using nohup without hitting enter key two times

How to configure htdigest in nagios server

Explore 90+ Article On "Linux Tips And Tricks"

You Might Like These Articles!

Internal External Command

What is Linux/Unix Internal And External Command

Linux basic command

Linux Basic Commands For Every Beginner

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission but Schools and Colleges can do in their Private Network
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy