Although Tarballing sounds like a whole lot more fun than it actually is... it's a utility that stores one or more files in a single archieve. The format of the tar command is:
tar [options] [FileToCreate] [FileListToInclude]
Not included in the man page for tar... at least not on Debian.
Common options:
Option
Description
-c
Create a new file
-v
Verbose... tell me what you are doing.
-z
Feed the output into gzip
-f
Create a file.
There are lots of other options...
Example:
tar -cvzf [tarball.file] File1.txt File2.txt File3.txt File4.txt
OR
tar -cvzf [tarball.file] File*.txt
CREATED2016-11-24 14:29:09.0
00-26-CA
UPDATED2016-11-24 14:29:13.0
Functions...
The first command line parameter is the function to perform. One of Acdrtux There should be only one of them... they don't play nice together.
Option
Word
Descrption
-A
--catenate --concatenate
Append the file to an existing archieve.
-c
--create
Create a new file.
-d
--diff --compare
Difference between two files.
--delete
Delete from archieve.
-r
--append
Append files to the end archieve.
-t
--list
List the contents of an archieve.
--test-label
Test the vol label and exit.
-u
--update
Append newer files.
-x
--extract --get
Extract the files from the archieve.
CREATED2016-11-24 14:44:22.0
00-26-CB
UPDATED2016-11-24 14:44:31.0
Options...
Options are different than functions. Where some functions can not be seen together, like c and x, options are not that way. May not make sense... but your mother won't be calling if you do.
There are a miriad of options when Tarballing, here are just a few of them... the important ones... I think.
Option
Long Word
Description
--add-file
add given file to the archieve. --add-file=myfile.txt
-C
--directory <dir>
change to directory dir
--checkpoint
Display a progress message every nth record. Default 10.
--checkpoint-action=<action>
execute action on every checkpoint.
--exclude=<pattern>
Exclude files that match pattern
-f
--file <filename>
The file to work on*
--group=<name>
Force the name of group on added files.
-h
--dereference
Follow symlinks and dump the files they point to.
--ignore-case
Ignore case
CREATED2016-11-24 14:44:37.0
00-26-CC
UPDATED2016-11-25 15:23:39.0
-N
--newer, --after-date <date or file>
only stores files newer than date or file
--overwrite
Overwrite existing files when extracting.
--owner=<name>
force name as owner
--recursion
Recurse into subdirectories (default)
--no-recursion
Do NOT recurse into subdirectories
--remove-files
Remove files after adding to the archieve
-T
--files-from <file>
Get file names to archieve from file
-v
--verbose
Verbosely list files processed.
-W
--verify
attempt to verify the archieve after writing it
-X
--excllude-from<file>
Exclude patterns listed in file
-z
--gzip --gunzip
Use gzip to compress files
NOTE: the -f options needs to be the last in line because the next command line argument is the file name to work on.
CREATED2016-11-25 15:19:57.0
00-26-CD
UPDATED2016-11-25 15:19:57.0
Listing the Contents of a Tarball...
To list the contents of an archieve...
tar -ztvf [tarFileName]
The z is for a zip file, leave that out if it is not a zip file. The t lists the contents. The v is for verbose and f is the switch for the file which must be the last switch so the file name follows it.
CREATED2017-12-05 02:54:58.0
008-00-00-07
UPDATED2017-12-05 02:55:13.0
Un-Tarballing...
Once you make an archieve... eventually... you have to unpack it. Use the same command to unpack it as you did to pack it... but... with the parameter. For eXtract.
-x
tar -xvf [tarball/filename]
You can't use x and c together. It isn't fun and tar doesn't like it.