Last active
August 4, 2024 06:45
-
-
Save santisbon/5283059 to your computer and use it in GitHub Desktop.
How to find files and text in the shell and work with them. #linux #search
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Linux and Cygwin | |
find /test -name \*.txt -exec sed -i 's/oldValue/newValue/g' {} \; | |
# OS X. | |
# The -i option requires a file extension. Use "" to overwrite the file in place. | |
find /test -name \*.txt -exec sed -i "" 's/oldValue/newValue/g' {} \; | |
# Find a string in current directory and subdirectories, excluding some directories. | |
grep -r --exclude-dir={node_modules,amplify} mystring . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment