Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

search a word in a text using grep in Linux

grep -Rw '/path/to/search/' -e 'pattern'
Desc: The -R flag sets grep to recursive mode, navigating through all the directories 
contained within the specified directory. The -w flag searches for whole word matches. This means that ‘red’ will match only ‘red’ surrounded by whitespace characters and not ‘redundant’ or ‘tired.’ The -e flag prefaces the pattern to search for. It supports regular expressions by default.
Comment

PREVIOUS NEXT
Code Example
Shell :: batch open url 
Shell :: how to run a .sh file 
Shell :: yum install gcc 
Shell :: bash floating point variables 
Shell :: correct git commit message 
Shell :: git squash commit 
Shell :: how to apply changes in a single file from stash 
Shell :: speed up ffmpeg video 
Shell :: terminal go back one directory mac 
Shell :: kali linux download 
Shell :: nuxt 3 install 
Shell :: ppsspp debian 10 
Shell :: update cpanel 
Shell :: copy files from local to host ssh 
Shell :: Importing SSH Keys 
Shell :: how to cat only the first ten lines of a file linux 
Shell :: Custom Bash Shell 
Shell :: how to uninstall cuda 
Shell :: change resolution of a video with terminal 
Shell :: remove untracked files git 
Shell :: bootar pendrive linux 
Shell :: search everithing for ubuntu 
Shell :: awk if 
Shell :: vi quit 
Shell :: install open jdk 8 mac homebrew 
Shell :: installing flutter_native_splash 
Shell :: git diff 
Shell :: bash for file in directory 
Shell :: exit status bash 
Shell :: delete remote git tags matching pattern 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =