how to grep
grep 'word' filename
fgrep 'word-to-search' file.txt
grep 'word' file1 file2 file3
grep 'string1 string2' filename
cat otherfile | grep 'something'
command | grep 'something'
command option1 | grep 'data'
grep --color 'data' fileName
grep [-options] pattern filename
fgrep [-options] words file# EXAMPLE 1: look for any files (with names ending in ".c++") for the text "::MethodA("
grep "::MethodA(" *.c++
# EXAMPLE 2: display only the matching file names (not the row too) of the matches
grep -l "MethodA(" *.c++
# SYNTAX
# grep [optional-filters] "<your-string-to-search>" <files-to-search>
# OPTIONAL-FILTERS
# +--------+----------------------------------------------------------------------------+
# | OPTION | DESCRIPTION |
# +--------+----------------------------------------------------------------------------+
# | -e | pattern |
# | -i | Ignore uppercase vs. lowercase. |
# | -v | Invert match. |
# | -c | Output count of matching lines only. |
# | -l | Output matching files only. |
# | -n | Precede each matching line with a line number. |
# | -b | A historical curiosity: precede each matching line with a block number. |
# | -h | Output matching lines without preceding them by file names. |
# | -s | Suppress error messages about nonexistent or unreadable files. |
# | -x | |
# | -f | file: Take regexes from a file. |
# | -o | Output the matched parts of a matching line. |
# +--------+----------------------------------------------------------------------------+'myFunction' is defined but never used no-unused-vars
Also in C++:
- Title
- install docker-compose ubuntu 20
- Category
- C++
- Title
- openssl dhparam isn't saved
- Category
- C++
- Title
- ssh add key to authorized_keys
- Category
- C++
- Title
- react router install
- Category
- C++
- Title
- install mongo compass
- Category
- C++
- Title
- catkin install
- Category
- C++
- Title
- git pull with submodules
- Category
- C++
- Title
- bash how to transpose a column
- Category
- C++
- Title
- how to monitor cpu core temperature using powershell
- Category
- C++
- Title
- install groovy on ubuntu
- Category
- C++
- Title
- show listing linux
- Category
- C++
- Title
- install node package manager ubuntu 18.04
- Category
- C++
- Title
- see what is using a port ubuntu
- Category
- C++
- Title
- linux remove last line from file
- Category
- C++
- Title
- copy from local to ssh ubuntu
- Category
- C++
- Title
- enable fish shell in alacrtity teminal
- Category
- C++
- Title
- aws instance creation using terraform
- Category
- C++
- Title
- how to install npm
- Category
- C++
- Title
- github merge
- Category
- C++
- Title
- rails add gem to gemfile
- Category
- C++
- Title
- android studio comment linux
- Category
- C++
- Title
- kill process from pid
- Category
- C++
- Title
- is there any method to do clearscreen mongo shell
- Category
- C++
- Title
- kill all server 5000 mac
- Category
- C++