Grep Search in Shell

Level 232 keystrokes

Searches all .js files under the current directory for TODO and prints each match as file:line:text.

Shell code

# -r: search recursively (with no path given, GNU grep searches .)
# -n: show line numbers; --include: only files matching *.js
1grep -rn "TODO" --include="*.js"

Output

src/app.js:15: // TODO: Add validation
src/utils.js:42: // TODO: Refactor this
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this Shell code and how often they appear.

  • "× 4
  • -× 3
  • .× 1
  • *× 1
  • =× 1

More Shell examples at level 2

← Shell typing practice