You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/os/command-line/commands/file-system.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,33 @@ Short-cuts:
59
59
<!--- TODO: add link to configure zsh and bash shells to always prompt for delete confirmation --->
60
60
61
61
62
+
63
+
## Archives
64
+
65
+
Tar (tape archive) is the long standing command for creating archives on Unix, optionally compressing the resulting file with one of several algorithms.
66
+
67
+
`tar -cf tar_file_name.tar <directory and/or files>` creates a new archive, `-c` for create, `-f` to specify archive file name.
68
+
69
+
`tar -cfz archive.tgz <directory and/or files>` creates a new archive using gzip compression.
70
+
71
+
Archive options:
72
+
73
+
-`z` gizip compression, `.tgz` file extension
74
+
-`j` bzip2 compression, `.tgj` file extension
75
+
-`J` xz compression, `.tgx` file extension
76
+
77
+
tar -xf archive.tar extracts everything from the archive, `-C` extracts to a given path.
78
+
79
+
tar can change the contents of an archive using `--concatenate`, `--delete`, `--append` and `--update` flags.
80
+
81
+
82
+
zip is a universal archive tool that compresses one or multiple files into a `.zip` archive, reducing the size of text based files. Binary files may result in a slightly bigger archive.
83
+
84
+
`zip [options] zip_file_name <directory and/or files>` creates a compressed archive.
85
+
86
+
`unzip [options] zip_file_name` extracts all the files form the archive.
0 commit comments