A simple and powerful command-line search tool for searching files. It searches recursively through all directories and subdirectories.
This tool searches for specific text in files and shows you:
- The name of the file where the text was found
- The line number where the text was found
node Search.js --text "search term"node Search.js --text "SearchTerm" --case-sensitivenode Search.js --text "pattern.*" --regexnode Search.js --text "function" --file-type ".js"node Search.js --text "error" --file-type ".log" --case-sensitive --regex| Option | Shortcut | Description |
|---|---|---|
--text |
-t |
Text to search for (required) |
--case-sensitive |
-c |
Case-sensitive search |
--regex |
-r |
Use regular expressions |
--file-type |
-f |
File type to search in (default: .txt) |
node Search.js --text "function" --file-type ".js"node Search.js --text "error" --file-type ".log"node Search.js --text "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}" --regex --file-type ".txt"node Search.js --text "userName" --case-sensitive --file-type ".js"The tool displays results in this format:
./src/main.js:15
./src/utils.js:42
./docs/README.txt:8
Where:
./src/main.js= file path:15= line number
- Code Review: Search for a specific function or variable
- Debugging: Search for error messages in log files
- Documentation: Search through documentation files
- Configuration: Search for specific settings in config files