]> wimlib.net Git - wimlib/blob - doc/man1/imagex-extract.1.in
Update version number in preparation of eventual v1.6.3 release
[wimlib] / doc / man1 / imagex-extract.1.in
1 .TH WIMLIB-IMAGEX "1" "May 2014" "@IMAGEX_PROGNAME@ @VERSION@" "User Commands"
2 .SH NAME
3 @IMAGEX_PROGNAME@-extract \- Extract files or directories from a WIM image
4 .SH SYNOPSIS
5 \fB@IMAGEX_PROGNAME@ extract\fR \fIWIMFILE\fR \fIIMAGE\fR [(\fIPATH\fR | @\fILISTFILE\fR)...]  [\fIOPTION\fR...]
6 .SH DESCRIPTION
7 \fB@IMAGEX_PROGNAME@ extract\fR extracts one or more files or directory trees
8 from the specified \fIIMAGE\fR contained in the Windows Imaging (WIM) file
9 \fIWIMFILE\fR.
10 This command is also available as simply \fBwimextract\fR if the appropriate hard
11 link or batch file has been installed.
12 .PP
13 \fB@IMAGEX_PROGNAME@ extract\fR is intended for extracting only a subset of a
14 WIM image.  If you want to extract or "apply" a full WIM image to a directory or
15 NTFS volume, use \fB@IMAGEX_PROGNAME@ apply\fR (1) instead.
16 .PP
17 \fIIMAGE\fR specifies the image in \fIWIMFILE\fR that contains the files or
18 directory trees to extract.  It may be a 1-based index of an image in the WIM or
19 the name of an image in the WIM.  Use the \fB@IMAGEX_PROGNAME@ info\fR (1)
20 command to show what images a WIM file contains.
21 .PP
22 If no additional arguments are given, the entire WIM image is extracted.
23 Otherwise, each additional argument is interpreted as a \fIPATH\fR if it does
24 not begin with the '@' character, or a \fILISTFILE\fR if it does.  Each
25 \fIPATH\fR specifies a file or directory tree within the WIM image to extract,
26 whereas each \fILISTFILE\fR specifies a file that itself contains a list of
27 paths to extract.  See \fBPATHS AND LISTFILES\fR for more details.
28 .PP
29 By default, files and directories are extracted to the current directory.  Use
30 \fB--dest-dir\fR to select a different destination directory.  Alternatively,
31 use \fB--to-stdout\fR to extract a file to standard output to pipe into another
32 program.
33 .PP
34 A file or directory extracted from a \fIPATH\fR argument is by default extracted
35 directly into the destination directory, whereas a file or directory extracted
36 from a \fILISTFILE\fR argument is by default extracted into the destination
37 directory in such a way that the archive's directory structure is
38 preserved.  Use \fB--preserve-dir-structure\fR to always get the latter
39 behavior.
40 .PP
41 \fB@IMAGEX_PROGNAME@ extract\fR supports extracting files and directory trees
42 from stand-alone WIMs as well as split WIMs.  See \fBSPLIT WIMS\fR.
43 .SH PATHS AND LISTFILES
44 Each path, including those on the command line and those in listfiles, must be
45 specified as an absolute path starting from the root of the WIM image, like
46 those output by the \fB@IMAGEX_PROGNAME@ dir\fR (1) command.  However, path
47 separators may be either forward or backward slashes, and the leading slash is
48 optional.
49 .PP
50 On Windows, by default paths are treated case-insensitively, whereas on
51 UNIX-like systems, by default paths are treated case-sensitively.  In either
52 case, the default behavior may be overridden through the
53 \fBWIMLIB_IMAGEX_IGNORE_CASE\fR environmental variable, as documented in
54 \fB@IMAGEX_PROGNAME@\fR (1).
55 .PP
56 By default, each path may contain the wildcard characters '?' and '*'.  The '?'
57 character matches any non-path-separator character, whereas the '*' character
58 matches zero or more non-path-separator characters.  Consequently, a single
59 wildcard pattern may expand to multiple actual files or directories.  Use the
60 \fB--no-wildcards\fR option to disable wildcard matching and search for each
61 path literally.
62 .PP
63 Each \fILISTFILE\fR must be a text file (UTF-8 or UTF-16LE encoded) that
64 contains a list of paths to extract, one per line.  Wildcard characters are
65 allowed by default.  The following demonstrates an example listfile:
66 .PP
67 .RS
68 .nf
69
70 ; This is a comment (begins with semicolon)
71 # This is also a comment (begins with number sign)
72 /Users
73 /Windows/explorer.exe
74 /Windows/System32/en-US/*
75
76 ; Both forward and backslashes are valid.
77 ; It's not necessary to quote paths containing internal spaces.
78 \\Program Files\\A*
79
80 ; Leading and trailing whitespace is ignored
81     \\Windows\\notepad*
82
83 .SH SPLIT WIMS
84 You may use \fB@IMAGEX_PROGNAME@ extract\fR to extract files or directory trees
85 from a split WIM.  This uses the \fB--refs\fR="\fIGLOB\fR" option in the same
86 way as in other commands such as \fB@IMAGEX_PROGNAME@ apply\fR.  See
87 \fB@IMAGEX_PROGNAME@ apply\fR (1) for more details.
88 .SH OPTIONS
89 .TP 6
90 \fB--check\fR
91 When reading \fIWIMFILE\fR, verify its integrity if an integrity table is
92 present.
93 .TP
94 \fB--ref\fR="\fIGLOB\fR"
95 File glob of additional WIMs or split WIM parts to reference resources from.
96 See \fBSPLIT_WIMS\fR.  Note: \fIGLOB\fR is listed in quotes because it is
97 interpreted by \fB@IMAGEX_PROGNAME@\fR and may need to be quoted to protect
98 against shell expansion.
99 .TP
100 \fB--dest-dir\fR=\fIDIR\fR
101 Extract the files and directories to the directory \fIDIR\fR instead of to the
102 current working directory.
103 .TP
104 \fB--to-stdout\fR
105 Extract the files to standard output instead of to the filesystem.  This can
106 only be provided if all the specified paths are to regular files (not
107 directories or reparse points).  If present, alternate data streams are not
108 extracted.
109 .TP
110 \fB--unix-data\fR
111 See the documentation for this option in \fB@IMAGEX_PROGNAME@-apply\fR (1).
112 .TP
113 \fB--no-acls\fR
114 See the documentation for this option in \fB@IMAGEX_PROGNAME@-apply\fR (1).
115 .TP
116 \fB--strict-acls\fR
117 See the documentation for this option in \fB@IMAGEX_PROGNAME@-apply\fR (1).
118 .TP
119 \fB--no-attributes\fR
120 See the documentation for this option in \fB@IMAGEX_PROGNAME@-apply\fR (1).
121 .TP
122 \fB--include-invalid-names\fR
123 See the documentation for this option in \fB@IMAGEX_PROGNAME@-apply\fR (1).
124 .TP
125 \fB--no-wildcards\fR
126 Do not interpret wildcard characters in paths.  Each path will be searched for
127 literally.
128 .TP
129 \fB--nullglob\fR
130 If a wildcard pattern (a.k.a. a "glob") does not match any paths, ignore it and
131 print a warning instead of failing with an error.  In other words, this option
132 allows a wildcard pattern to successfully match zero files.  Note that this
133 applies even if one of the paths does not contain wildcard characters.  Such a
134 path is still treated as a "wildcard pattern", so with this option it may not
135 match anything and therefore produce no error.  This option cannot be combined
136 with \fB--no-wildcards\fR, as that would be meaningless.
137 .TP
138 \fB--preserve-dir-structure\fR
139 When extracting paths, preserve the archive directory structure instead of
140 extracting the file or directory tree named by each path directly to the
141 destination directory.  Note: \fB--preserve-dir-structure\fR is already the
142 default behavior for paths in listfiles, but not paths directly specified on the
143 command line.
144 .TP
145 \fB--wimboot\fR
146 See the documentation for this option in \fB@IMAGEX_PROGNAME@-apply\fR (1).
147 .SH NOTES
148 See the documentation \fB@IMAGEX_PROGNAME@ apply\fR (1) for documentation about
149 what data and metadata are extracted on UNIX-like systems versus on Windows.
150 .PP
151 On UNIX-like systems that support userspace filesystems with FUSE (e.g. Linux),
152 one can alternatively mount the WIM image with \fB@IMAGEX_PROGNAME@ mount\fR (1)
153 and then extract the desired files or directories using any standard
154 command-line or graphical program.
155 .PP
156 Reparse-point fixups (a.k.a. changing absolute symbolic links and junctions to
157 point within the extraction location) are never done by \fB@IMAGEX_PROGNAME@
158 extract\fR.  Use \fB@IMAGEX_PROGNAME@ apply\fR if you want this behavior.
159 .PP
160 Unlike \fB@IMAGEX_PROGNAME@ apply\fR, \fB@IMAGEX_PROGNAME@ extract\fR does not
161 support extracting files directly to a NTFS volume using libntfs-3g.
162 .PP
163 wimlib v1.6.0 and later can extract files from version 3584 WIMs, which usually
164 use packed, LZMS-compressed streams and may carry the \fI.esd\fR file extension
165 rather than \fI.wim\fR.  However, \fI.esd\fR files downloaded directly by the
166 Windows 8 web downloader have encrypted segments, and wimlib cannot extract such
167 files until they are first decrypted.  Furthermore, such files are not designed
168 for random access, so extracting individual files from them may be slow.
169 .SH EXAMPLES
170 Extract a file from the first image in "boot.wim" to the current directory:
171 .RS
172 .PP
173 @IMAGEX_PROGNAME@ extract boot.wim 1 /Windows/System32/notepad.exe
174 .RE
175 .PP
176 Extract a file from the first image in "boot.wim" to standard output:
177 .RS
178 .PP
179 @IMAGEX_PROGNAME@ extract boot.wim 1 /Windows/System32/notepad.exe \\
180 .br
181 .RS
182 --to-stdout
183 .RE
184 .RE
185 .PP
186 Extract a file from the first image in "boot.wim" to the specified directory:
187 .RS
188 .PP
189 @IMAGEX_PROGNAME@ extract boot.wim 1 /Windows/System32/notepad.exe \\
190 .br
191 .RS
192 --dest-dir=somedir
193 .RE
194 .RE
195 .PP
196 Extract the "sources" directory from the first image in "boot.wim" to the
197 current directory:
198 .RS
199 .PP
200 @IMAGEX_PROGNAME@ extract boot.wim 1 /sources
201 .RE
202 .PP
203 Extract multiple files and directories in one command:
204 .RS
205 .PP
206 @IMAGEX_PROGNAME@ extract boot.wim 1 /Windows/Fonts \\
207 .br
208 .RS
209 /sources /Windows/System32/cmd.exe
210 .RE
211 .RE
212 .PP
213 Extract many files to the current directory using a wildcard pattern:
214 .RS
215 .PP
216 @IMAGEX_PROGNAME@ extract install.wim 1 "/Windows/Fonts/*.ttf"
217 .RE
218 .PP
219 Extract files using a list file:
220 .RS
221 .PP
222 @IMAGEX_PROGNAME@ extract install.wim 1 @files.txt
223 .RE
224 .PP
225  ...  where files.txt could be something like:
226 .PP
227 .RS
228 .RS
229 .nf
230 Windows\\System32\\*.*
231 Windows\\System32\\??-??\\*.*
232 Windows\\System32\\en-US\\*.*
233 .RE
234 .RE
235 .fi
236 .SH SEE ALSO
237 .BR @IMAGEX_PROGNAME@ (1)
238 .BR @IMAGEX_PROGNAME@-apply (1)
239 .BR @IMAGEX_PROGNAME@-dir (1)
240 .BR @IMAGEX_PROGNAME@-info (1)
241 .BR @IMAGEX_PROGNAME@-mount (1)