12 ms·
It can have strange behavior though. The other day I went into iTerm2, changed to the top of my Xcode projects top directory and did "find . | xargs grep abcd"
by Ologn 9y ago
It can have strange behavior though.
The other day I went into iTerm2, changed to the top of my Xcode projects top directory and did "find . | xargs grep abcd". Nothing was found. This wasted my time for 30 minutes and then I did a cd to the directory where the Swift files were and did the same command. Immediately I saw the file with the abcd string in it.
This type of thing doesn't happen to me on Ubuntu.
That said, things like iTerm2, Homebrew etc. do make using MacOS somewhat tolerable.
- derefr 9y agoYour Xcode project directory probably had spaces in its path somewhere (which, for reasons of rather outdated conventions, is less common to encounter under Linux.) Like with any other Unix, dealing with spaces in the arguments passing through a pipeline to xargs(1) requires the NUL-delimited style: find . -print0 | xargs -0 grep abcd or you can stop worrying about the spaces by letting find(1) handle them: find . -exec grep abcd \{\} \; or, even better, get grep(1) to do the whole job (which also has the advantage of tagging each found line with the filename the result was found in): grep -R abcd .
- emmelaich 9y agoMy iTerm2 disappeared in the upgrade to High Sierra. I don't know why. I started to use the standard terminal and found it much more responsive that iTerm2. I never used most of the iTerm2 features anyway. I'm sticking to the standard terminal for the time being.