Using 'find' and 'grep' (and 'sed' to take care of filenames with spaces) Mac OS X 10.4 users can use mdfind, the command line counterpart to Spotlight. Use the '-live' switch to monitor the results of this search in real time. grep patternsPRETTY OUTPUTignore binary files whole word matches DETAILED OUTPUT:Show the file name, line number, and the line - not pretty, but useful Find and Replace strings within a batch of filesperl -pi -e 's/find/replace/g' *.txtOr, to change files in a nested folder structyre: find . -name '*.txt' | xargs perl -pi -e 's/find/replace/g'
ALWAYS DOUBLE-CHECK FIRST, ESPECIALLY WHEN USING ANY SPECIAL CHARACTERS! YOU COULD EASILY DO YOURSELF A LOT OF DAMAGE!! |
Search The Site: Site Categories:
|