본문 바로가기
OS/Linux

exec와 xargs 차이

by 신군. 2022. 1. 8.
반응형

exec와 xargs 차이

 

find . -name H* -exec ls -l {} \; executes the command ls -l on each individual file.

find . -name H* | xargs ls -l constructs an argument list from the output of the find commend and passes it to ls.

consider if the ouput of the find command produced:
H1
H2
H3

the first command would execute
ls -l H1
ls -l H2
ls -l H3

but the second would execute
ls -l H1 H2 H3 

반응형

'OS > Linux' 카테고리의 다른 글

디렉토리 일괄변경  (0) 2022.02.21
[Linux/Unix] find 의 고급기능  (0) 2022.01.08
centos8 docker install  (0) 2020.08.31
How to Install Java on Linux Mint 19  (0) 2020.01.11
OpenSSL 버전 업데이트/업그레이드 하기  (0) 2019.10.07