Tag Archive for tar

Un-tar a specific directory inside of a tar

tar zxvf latest.tar.gz --strip 1

source

Include list of files to tar on MAC OSX

tar -czf archive.tar.gz -T modfiles.txt

source

Un-tar/gzip for multiple files

for i in *.tar.gz; do tar -xzvf $i; done

source

*nix – tar create and expand archives

# create:
tar -cvzf <output filename> <directory>

# this means:
# -c = create new archive
# -v = be verbose
# -z = compress using gzip
# -f = filename to create for the new archive

# for the directory dinnae put "directory/*" just  "directory" with no slash
#
# filenames should end in '.tar.gz' as they are tar'ed then zipped
#
# expand [on server]:

tar -xvf <filename>.tar.gz

# if it's a tar.bz2 archive, use the following:

tar -jxvf <filename>.tar.bz2

source

*nix – tar create and expand archives

# create:
tar -cvzf <output filename> <directory>

# this means:
# -c = create new archive
# -v = be verbose
# -z = compress using gzip
# -f = filename to create for the new archive

# for the directory dinnae put "directory/*" just  "directory" with no slash
#
# filenames should end in '.tar.gz' as they are tar'ed then zipped
#
# expand [on server]:

tar -xvf <filename>.tar.gz

# if it's a tar.bz2 archive, use the following:

tar -jxvf <filename>.tar.bz2

source

Extract a tar.bz2 compressed file

tar xjvf filename.tar.bz2

source

tar basics

# create
tar cvf docs.tar docs2

# extract
tar xvf docs.tar

source

Create a .tar.gz archive using Terminal OS X

tar -pvczf BackUpDirectory.tar.gz /path/to/directory

//Back up a directory but exclude .hidden files
tar --exclude=".*" -pvczf BackUpDirectory.tar.gz /path/to/directory

source

Archive using tar and bzip2

To create a bzip2-compressed tar-file:

tar -cjf archivefile.tar.bz2 file-list


Decompressing in GNU tar:

tar -xjf archivefile.tar.bz2

source

Tar a Directory

tar czf application.tar.gz application/

source