I want ONLY directories and files that contain the letter. I've been able to recreate it from a previous question. But the tar is not a gzip.
And when trying to make it a gzip it...doesn't remove leading ´/' from hard link targets? which ruins it.
Here's the modified code (not gzip)
find /path/to/dir/ -type d -name "*x*" -o -type f -name "*x*" -exec tar rvf x.tar.gz {} \;
Gzip:
find /path/to/dir/ -type d -name "*x*" -o -type f -name "*x*" -exec tar cvzf x.tar.gz {} \;
The same amount of files appear during the process, but when checking the tar (tf) only a single file that starts with x appears...
Is it not possible to do with gzip, or am I missing an easier solution...