xargs 명령어 사용법

기본 사용법

[root@localhost bugbear]# find /home/* -type d | xargs echo
/home/assassin /home/bugbear /home/cobolt /home/darkelf /home/darkknight /home/death_knight /home/gate /home/gate/shellcode /home/gate/rooting /home/giant /home/goblin /home/golem /home/gremlin /home/lost+found /home/nightmare /home/orc /home/orge /home/skeleton /home/succubus /home/troll /home/vampire /home/wolfman /home/xavius /home/zombie_assassin

-i 옵션을 통한 인자 변경

[root@localhost bugbear]# find /home/* -type d | xargs -i echo {}/
/home/assassin/
/home/bugbear/
/home/cobolt/
/home/darkelf/
/home/darkknight/
/home/death_knight/
/home/gate/
/home/gate/shellcode/
/home/gate/rooting/
/home/giant/
/home/goblin/
/home/golem/
/home/gremlin/
/home/lost+found/
/home/nightmare/
/home/orc/
/home/orge/
/home/skeleton/
/home/succubus/
/home/troll/
/home/vampire/
/home/wolfman/
/home/xavius/
/home/zombie_assassin/

댓글 남기기

이메일은 공개되지 않습니다. 필수 입력창은 * 로 표시되어 있습니다