https://github.com/filipporaciti/search-string-in-files
Command line tool that search strings in all files of a directory
https://github.com/filipporaciti/search-string-in-files
bash files python python3 search
Last synced: 3 months ago
JSON representation
Command line tool that search strings in all files of a directory
- Host: GitHub
- URL: https://github.com/filipporaciti/search-string-in-files
- Owner: filipporaciti
- Created: 2023-04-21T17:02:32.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-09T16:46:17.000Z (about 3 years ago)
- Last Synced: 2025-04-12T13:00:53.618Z (about 1 year ago)
- Topics: bash, files, python, python3, search
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Search-String-In-Files
## Use
Giving a string and the path of the directory where you want to search, this program give to you every files and the row where this string is.
### Basic usage
``` bash
ssif "local" "./directory"
# Output
# ./install.sh --> (0) cp ssif.py /usr/local/bin
# ./install.sh --> (1) mv /usr/local/bin/ssif.py /usr/local/bin/ssif
# ./README.md --> (7) ssif "local" "./directory"
# ./remove.sh --> (0) rm /usr/local/bin/ssif
# ./.git/hooks/fsmonitor-watchman.sample --> (64) local $, = "\0";
# ./.git/hooks/fsmonitor-watchman.sample --> (107) my $response = do {local $/; };
# ./.git/hooks/pre-push.sample --> (16) #
# ./.git/hooks/pre-push.sample --> (26) while read local_ref local_oid remote_ref remote_oid
# ./.git/hooks/pre-push.sample --> (28) if test "$local_oid" = "$zero"
# ./.git/hooks/pre-push.sample --> (36) range="$local_oid"
# ./.git/hooks/pre-push.sample --> (39) range="$remote_oid..$local_oid"
# ./.git/hooks/pre-push.sample --> (46) echo >&2 "Found WIP commit in $local_ref, not pushing"
# ./.git/hooks/push-to-checkout.sample --> (37) # branches while keeping the local changes in the working tree that do
```
The first string is the string that you want to search, while the second string is the directory.
### Verbose
You can see also the file where the string is not here with the fiels `--verbose` or `-v`
``` bash
ssif "local" "./" -v
# Output (only first 10 lines)
# ./install.sh --> (0) cp ssif.py /usr/local/bin
# ./install.sh --> (1) mv /usr/local/bin/ssif.py /usr/local/bin/ssif
# Not here --> ./README.md
# Not here --> ./README.md
# Not here --> ./README.md
# Not here --> ./README.md
# Not here --> ./README.md
# Not here --> ./README.md
# Not here --> ./README.md
# ./README.md --> (7) ssif "local" "./directory"
```
### Blacklist
With this field you can set directory or file's blacklist. You can set one file/directory with tag `--blacklist fileordirectory` or more file/directory with tag `--blacklist "1fileordirectory 2fileordirectory 3fileordirectory..."`
``` bash
ssif --blacklist "README.md .git" "local" "./"
# Output
# ./install.sh --> (0) cp ssif.py /usr/local/bin
# ./install.sh --> (1) mv /usr/local/bin/ssif.py /usr/local/bin/ssif
# ./remove.sh --> (0) rm /usr/local/bin/ssif
```
## Install
``` bash
sudo ./install.sh
```
## Uninstall
``` bash
sudo ./remove.sh
```