tar with –include pattern

GNU tar has a -T or –files-from option that can take a file containing a list of files to include. The file specified with this option can be “-” for stdin. So, you can pass an arbitrary list of files for tar to archive from stdin using -files-from –. Using find patterns to generate a … Read more

Extract files contained in archive.tar.gz to new directory named archive

Update since GNU tar 1.28: use –one-top-level, see https://www.gnu.org/software/tar/manual/tar.html#index-one_002dtop_002dlevel_002c-summary Older versions need to script this. You can specify the directory that the extract is placed in by using the tar -C option. The script below assumes that the directories do not exist and must be created. If the directories do exist the script will still … Read more

How can I build a tar from stdin?

Something like: tar cfz foo.tgz –files-from=- But keep in mind that this won’t work for all possible filenames; you should consider the –null option and feed tar from find -print0. (The xargs example won’t quite work for large file lists because it will spawn multiple tar commands.)

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)