grep -r "texthere" .
The first parameter represents the regular expression to search for, while the second one represents the directory that should be searched. In this case, .
means the current directory.
Note: This works for GNU grep, and on some platforms like Solaris you must specifically use GNU grep as opposed to legacy implementation. For Solaris this is the ggrep
command.
Related Posts:
- How do I grep recursively?
- How do I grep recursively?
- How do I use grep to search the current directory for all files having the a string “hello” yet display only .h and .cc files?
- How can I exclude directories from grep -R?
- How can I exclude directories from grep -R?
- Diff command along with Grep gives “Binary file (standard input) matches”
- How do I find all files containing specific text on Linux?
- How to perform grep operation on all files in a directory?
- SSH using python script
- Argument list too long error for rm, cp, mv commands
- Difference between using “chmod a+x” and “chmod 755”
- How to cat <
> a file containing code? - Extract file basename without path and extension in bash
- Given two directory trees, how can I find out which files differ by content?
- How to download a file from server using SSH?
- What is the difference between “#!/usr/bin/env bash” and “#!/usr/bin/bash”?
- What does `set -x` do?
- Command to change the default home directory of a user
- How to get the process ID to kill a nohup process?
- How to grep and replace
- Using ls to list directories and their total sizes
- What does “&” at the end of a linux command mean?
- Can’t remove a directory in Unix
- Syntax error near unexpected token ‘then’
- C fopen vs open
- How can I use grep to show just filenames on Linux?
- Using grep and ls -a commands
- Restarting cron after changing crontab file?
- How do I write stderr to a file while using “tee” with a pipe?
- cd into directory without having permission
- Copying a large directory tree locally? cp or rsync?
- Can I nohup/screen an already-started process?
- Environment variables of a running process on Unix?
- In my /etc/hosts/ file on Linux/OSX, how do I do a wildcard subdomain?
- When does /tmp get cleared?
- SSL Certificate Location on UNIX/Linux
- Is it possible to detach a process from its terminal? (Or, “I should have used screen!”) [duplicate]
- What does ‘set -e’ do, and why might it be considered dangerous?
- Meaning of directories on Unix and Unix like systems
- How to remove empty/blank lines from a file in Unix (including spaces)?
- How to forcibly close a socket in TIME_WAIT?
- How can I rename a Unix user?
- How to get pid of just started process
- Can you have more than one ~/.ssh/config file?
- How to disable everything in crontab -l?
- How to sort ps output by process start time?
- Confused about stdin, stdout and stderr?
- How to set the environmental variable LD_LIBRARY_PATH in linux
- What’s a .sh file?
- How to fix ‘sudo: no tty present and no askpass program specified’ error?
- What does pss mean in /proc/pid/smaps
- apt-get error: Sub-process /usr/bin/dpkg returned an error code (1)
- how to find libstdc++.so.6: that contain GLIBCXX_3.4.19 for RHEL 6?
- subprocess.Popen(): OSError: [Errno 8] Exec format error in python?
- How can I recursively find all files in current and subfolders based on wildcard matching?
- Curl command for https ( SSL )
- Explaining the ‘find -mtime’ command
- WSL – GEDIT Unable to init server: Could not connect: Connection refused
- Install tkinter for Python
- Uncompress tar.gz file
- Linux error while loading shared libraries: cannot open shared object file: No such file or directory
- Pseudo-terminal will not be allocated because stdin is not a terminal
- curl: (6) Could not resolve host: google.com; Name or service not known
- How to pass password to scp?
- scp gives “not a regular file”
- How to use regex with find command?
- CentOS error – sudo: effective uid is not 0, is sudo installed setuid root?
- Merge / convert multiple PDF files into one PDF
- scp from Linux to Windows
- How do I find the MySQL my.cnf location
- node.js: cannot find module ‘request’
- What is the reason and how to avoid the [FIN, ACK] , [RST] and [RST, ACK]
- wget returns “Unable to establish SSL connection”
- How to make rpm auto install dependencies
- List all mounts in Linux
- How to use sed to extract substring
- error : storage class specified for parameter
- Wait for user input in C?
- WordPress Update – This is usually due to inconsistent file permissions.: wp-admin/includes/update-core.php
- WordPress sites being filled with random PHP files
- Is it a good idea to edit WordPress within Eclipse? [closed]
- How to run a server on port 80 as a normal user on Linux?
- Moving an already-running process to Screen
- Permission denied (publickey). SSH from local Ubuntu to Amazon EC2 server
- LVM dangers and caveats
- How to know from which yum repository a package has been installed?
- tar – Remove leading directory components on extraction
- How to list Apache enabled modules?
- How can I monitor hard disk load on Linux?
- What’s the reverse DNS command line utility?
- How to add a security group to a running EC2 Instance?
- How bad is it really to install Linux on one big partition?
- How do I extract login history?
- SSH from A through B to C, using private key on B [closed]
- Is it possible to reboot a Linux OS without rebooting the hardware?
- Does the “bs” option in “dd” really improve the speed?
- What solutions exist to allow the use of revision control for server configuration files? [closed]
- Is there a way to do a remote “ls” much like “scp” does a remote copy?
- Dump a linux process’s memory to file
- What is the difference between /sbin/nologin and /bin/false?