Miscellaneous bits and bobs from the tech world
9/23/2022, 11:13:13 AM
You can't cd in xargs because xargs is not a shell... or something. You have to invoke bash.
cd
xargs
ls -1 directory | xargs -n1 -I{} bash -c 'cd {}; echo foobar'
Use -t if you want to see the resulting command executed.
-t