1

I'm looking for a UNIX one-liner that will output to a file all occurrences of NSLocalizedString (from that word to the end of the line) in all files in the current directory and all subdirectories. I've googled, but haven't found a solution.

4

2 回答 2

3
find . -type f -exec fgrep NSLocalizedString {} \+ | \
    sed -e 's/^.*\(NSLocalizedString.*\)$/\1/' > ../your_output_file
于 2012-06-04T19:08:18.890 回答
0

find <directory> -type f -print | xargs grep NSLocalizedString | tee <outputfile> should do what you're looking for, if I understand the question right...

于 2012-06-04T19:07:14.580 回答