Created
November 20, 2024 21:37
-
-
Save Shaun289/a567f6732cb6e06cc53f26ce85357b65 to your computer and use it in GitHub Desktop.
Test xargs in macos
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
# Tested in macOS Sonoma 14.5 | |
# Reference : https://johngrib.github.io/wiki/mac/terminal-guide/03/#-i-%EC%98%B5%EC%85%98%EA%B3%BC-placeholder | |
% echo $SHELL | |
/bin/zsh | |
% seq 10 | xargs -I {} echo {} | |
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
% touch test | |
% ls test | |
test | |
# run xargs with find | |
# xargs -I {} : set {} as placeholder usually. | |
# | : pipe | |
# rm -v : verbose | |
% find . -name test | xargs -I {} rm -v {} | |
./test | |
% ls test | |
ls: test: No such file or directory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment