backsetr.blogg.se

Unix tar compress folder to another directory
Unix tar compress folder to another directory








unix tar compress folder to another directory

#UNIX TAR COMPRESS FOLDER TO ANOTHER DIRECTORY ARCHIVE#

This gives the archive entries the same meta data as those in the dist archive for binaries.

unix tar compress folder to another directory

Reduce the dependency on external tools by generating the distribution archives for HTML documentation and manpages using git ( man) commands instead of tar. (Merged by Junio C Hamano - gitster - in commit 63e5273, ) Makefile: use git init/add/commit/archive for dist-doc See commit 4813277 (), and commit 93e7031 () by René Scharfe ( rscharfe). (You don't need Git 2.30 to apply that alternative) If you have multiple tar files to exclude, use ' *', as in -exclude=./*.gz.ġ0 years later, you have an alternative to tar, illustrated with Git 2.30 (Q1 2021), which uses " git archive" ( man) to produce the release tarball You might need to specify -exclude=./ if you are working in the current directory contrary to recommendations you might need to specify -exclude=workspace/ if you are working up one level as suggested. The string after the = is a pattern - the example is the simplest pattern - an exact match. Or: if you are using GNU Tar, use the -exclude= option.Either: create the file somewhere else - /tmp is one possible location - and then move it back to the original location after it is complete.The second part of the comment can be dealt with in one of two ways: The first part of the comment does not make much sense - if the tar file contains the current directory, it won't be created when you extract file from that archive because, by definition, the current directory already exists (except in very weird circumstances). I need to exclude the top directory and I need to place the tar in the base directory. Stupid that it is not the default behaviour in my view - confusing, at least, for those for whom cd. If you have to worry about that, use cd -P. (This assumes that you didn't follow symlinks to get to where you are and that the shell doesn't try to second guess you by jumping backwards through a symlink - bash is not trustworthy in this respect. Or, if you don't know the name of the directory you were in: base=$(basename $PWD) ĭoes the trick, except it will extract the files all over the current directory when you unpack. Don't create the tar file in the directory you are packing up: tar -czf /tmp/.










Unix tar compress folder to another directory