with apologies

Tarballing some files

Richard Mortier · August 25, 2021 · #old #linux

I recently discovered, to some irritation, that the --include PATTERN option to tar seems only to apply to directories – and if the PATTERN doesn’t match, it won’t traverse subdirectories. But I wanted to include *.php for some reason. So instead pipe the output of find, or better these days, fd:

fd -e php -0 | tar -cvjf TARBALL.bz2 --null --files-from -