-c
compress
-J
xz compression-j
bzip2 compression-lzma
lzma compression-z
gzip compression
-x
expand
-v
verbose
-p
keep files permissions
-f
target file (must be right before file)
Expand to current directory
bsdtar -xf file.tar.xz
Expand to target
mkdir target
bsdtar -xf file.tar.xz -C target
Expand sub directory
bsdtar -xf file.tar.xz -C target subdirectory/
Expand not include root directory of compressed.file to target
bsdtar -xf file.tar.xz --strip 1 -C target
Compress to xz
bsdtar -cJf file.tar.xz files