Skip to content

Commit ab59908

Browse files
os: archive commands in file systems page
1 parent 73bcbb7 commit ab59908

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- os: command-line commands section
2222
- source-control: add rationale for signing commits
2323
- os: debian linux trixie archive resolves xorg change
24+
- os: archive commands in file systems page
2425

2526
### Changed
2627

docs/os/command-line/commands/file-system.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,33 @@ Short-cuts:
5959
<!--- TODO: add link to configure zsh and bash shells to always prompt for delete confirmation --->
6060

6161

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.
87+
88+
6289
## Find files and contents
6390

6491

0 commit comments

Comments
 (0)