These examples were compiled by the TL;DR community at tldr.sh.
---
doc/tar.1 | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/doc/tar.1 b/doc/tar.1
index ddf4fdc..d4fa206 100644
--- a/doc/tar.1
+++ b/doc/tar.1
@@ -1288,6 +1288,37 @@ a compression option (e.g. \fB\-z\fR) was used and the external
compressor program failed. Another example is
.B rmt
failure during backup to a remote device.
+.SH "EXAMPLES"
+.PP
+Create an archive from files:
+.IP
+\fBtar cf\fR \fItarget.tar file1 file2 file3\fR
+.PP
+Create a gzipped archive:
+.IP
+\fBtar czf\fR \fItarget.tar.gz file1 file2 file3\fR
+.PP
+Extract an archive in a target folder:
+.IP
+\fBtar xf\fR \fIsource.tar\fR \fB-C\fR \fIfolder\fR
+.PP
+Extract a gzipped archive in the current directory:
+.IP
+\fBtar xzf\fR \fIsource.tar.gz\fR
+.PP
+Extract a bzipped archive in the current directory:
+.IP
+\fBtar xjf\fR \fIsource.tar.bz2\fR
+.PP
+Create a compressed archive, using archive suffix to determine the
+compression program:
+.IP
+\fBtar caf\fR \fItarget.tar.xz file1 file2 file3\fR
+.PP
+List the contents of a tar file:
+.IP
+\fBtar tvf\fR \fIsource.tar\fR
+.PP
.SH "SEE ALSO"
.BR bzip2 (1),
.BR compress (1),
--
2.7.4