]> wimlib.net Git - wimlib/blob - doc/man1/imagex-extract.1.in
imagex-extract.1.in: Note that ASCII pathlist is fine
[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; plain ASCII
64 is also fine) that
65 contains a list of paths to extract, one per line.  Wildcard characters are
66 allowed by default.  The following demonstrates an example listfile:
67 .PP
68 .RS
69 .nf
70
71 ; This is a comment (begins with semicolon)
72 # This is also a comment (begins with number sign)
73 /Users
74 /Windows/explorer.exe
75 /Windows/System32/en-US/*
76
77 ; Both forward and backslashes are valid.
78 ; It's not necessary to quote paths containing internal spaces.
79 \\Program Files\\A*
80
81 ; Leading and trailing whitespace is ignored
82     \\Windows\\notepad*
83
84 .SH SPLIT WIMS
85 You may use \fB@IMAGEX_PROGNAME@ extract\fR to extract files or directory trees
86 from a split WIM.  This uses the \fB--refs\fR="\fIGLOB\fR" option in the same
87 way as in other commands such as \fB@IMAGEX_PROGNAME@ apply\fR.  See
88 \fB@IMAGEX_PROGNAME@ apply\fR (1) for more details.
89 .SH OPTIONS
90 .TP 6
91 \fB--check\fR
92 When reading \fIWIMFILE\fR, verify its integrity if an integrity table is
93 present.
94 .TP
95 \fB--ref\fR="\fIGLOB\fR"
96 File glob of additional WIMs or split WIM parts to reference resources from.
97 See \fBSPLIT_WIMS\fR.  Note: \fIGLOB\fR is listed in quotes because it is
98 interpreted by \fB@IMAGEX_PROGNAME@\fR and may need to be quoted to protect
99 against shell expansion.
100 .TP
101 \fB--dest-dir\fR=\fIDIR\fR
102 Extract the files and directories to the directory \fIDIR\fR instead of to the
103 current working directory.
104 .TP
105 \fB--to-stdout\fR
106 Extract the files to standard output instead of to the filesystem.  This can
107 only be provided if all the specified paths are to regular files (not
108 directories or reparse points).  If present, alternate data streams are not
109 extracted.
110 .TP
111 \fB--unix-data\fR
112 See the documentation for this option in \fB@IMAGEX_PROGNAME@-apply\fR (1).
113 .TP
114 \fB--no-acls\fR
115 See the documentation for this option in \fB@IMAGEX_PROGNAME@-apply\fR (1).
116 .TP
117 \fB--strict-acls\fR
118 See the documentation for this option in \fB@IMAGEX_PROGNAME@-apply\fR (1).
119 .TP
120 \fB--no-attributes\fR
121 See the documentation for this option in \fB@IMAGEX_PROGNAME@-apply\fR (1).
122 .TP
123 \fB--include-invalid-names\fR
124 See the documentation for this option in \fB@IMAGEX_PROGNAME@-apply\fR (1).
125 .TP
126 \fB--no-wildcards\fR
127 Do not interpret wildcard characters in paths.  Each path will be searched for
128 literally.
129 .TP
130 \fB--nullglob\fR
131 If a wildcard pattern (a.k.a. a "glob") does not match any paths, ignore it and
132 print a warning instead of failing with an error.  In other words, this option
133 allows a wildcard pattern to successfully match zero files.  Note that this
134 applies even if one of the paths does not contain wildcard characters.  Such a
135 path is still treated as a "wildcard pattern", so with this option it may not
136 match anything and therefore produce no error.  This option cannot be combined
137 with \fB--no-wildcards\fR, as that would be meaningless.
138 .TP
139 \fB--preserve-dir-structure\fR
140 When extracting paths, preserve the archive directory structure instead of
141 extracting the file or directory tree named by each path directly to the
142 destination directory.  Note: \fB--preserve-dir-structure\fR is already the
143 default behavior for paths in listfiles, but not paths directly specified on the
144 command line.
145 .TP
146 \fB--wimboot\fR
147 See the documentation for this option in \fB@IMAGEX_PROGNAME@-apply\fR (1).
148 .SH NOTES
149 See the documentation \fB@IMAGEX_PROGNAME@ apply\fR (1) for documentation about
150 what data and metadata are extracted on UNIX-like systems versus on Windows.
151 .PP
152 On UNIX-like systems that support userspace filesystems with FUSE (e.g. Linux),
153 one can alternatively mount the WIM image with \fB@IMAGEX_PROGNAME@ mount\fR (1)
154 and then extract the desired files or directories using any standard
155 command-line or graphical program.
156 .PP
157 Reparse-point fixups (a.k.a. changing absolute symbolic links and junctions to
158 point within the extraction location) are never done by \fB@IMAGEX_PROGNAME@
159 extract\fR.  Use \fB@IMAGEX_PROGNAME@ apply\fR if you want this behavior.
160 .PP
161 Unlike \fB@IMAGEX_PROGNAME@ apply\fR, \fB@IMAGEX_PROGNAME@ extract\fR does not
162 support extracting files directly to a NTFS volume using libntfs-3g.
163 .PP
164 wimlib v1.6.0 and later can extract files from version 3584 WIMs, which usually
165 use packed, LZMS-compressed streams and may carry the \fI.esd\fR file extension
166 rather than \fI.wim\fR.  However, \fI.esd\fR files downloaded directly by the
167 Windows 8 web downloader have encrypted segments, and wimlib cannot extract such
168 files until they are first decrypted.  Furthermore, such files are not designed
169 for random access, so extracting individual files from them may be slow.
170 .SH EXAMPLES
171 Extract a file from the first image in "boot.wim" to the current directory:
172 .RS
173 .PP
174 @IMAGEX_PROGNAME@ extract boot.wim 1 /Windows/System32/notepad.exe
175 .RE
176 .PP
177 Extract a file from the first image in "boot.wim" to standard output:
178 .RS
179 .PP
180 @IMAGEX_PROGNAME@ extract boot.wim 1 /Windows/System32/notepad.exe \\
181 .br
182 .RS
183 --to-stdout
184 .RE
185 .RE
186 .PP
187 Extract a file from the first image in "boot.wim" to the specified directory:
188 .RS
189 .PP
190 @IMAGEX_PROGNAME@ extract boot.wim 1 /Windows/System32/notepad.exe \\
191 .br
192 .RS
193 --dest-dir=somedir
194 .RE
195 .RE
196 .PP
197 Extract the "sources" directory from the first image in "boot.wim" to the
198 current directory:
199 .RS
200 .PP
201 @IMAGEX_PROGNAME@ extract boot.wim 1 /sources
202 .RE
203 .PP
204 Extract multiple files and directories in one command:
205 .RS
206 .PP
207 @IMAGEX_PROGNAME@ extract boot.wim 1 /Windows/Fonts \\
208 .br
209 .RS
210 /sources /Windows/System32/cmd.exe
211 .RE
212 .RE
213 .PP
214 Extract many files to the current directory using a wildcard pattern:
215 .RS
216 .PP
217 @IMAGEX_PROGNAME@ extract install.wim 1 "/Windows/Fonts/*.ttf"
218 .RE
219 .PP
220 Extract files using a list file:
221 .RS
222 .PP
223 @IMAGEX_PROGNAME@ extract install.wim 1 @files.txt
224 .RE
225 .PP
226  ...  where files.txt could be something like:
227 .PP
228 .RS
229 .RS
230 .nf
231 Windows\\System32\\*.*
232 Windows\\System32\\??-??\\*.*
233 Windows\\System32\\en-US\\*.*
234 .RE
235 .RE
236 .fi
237 .SH SEE ALSO
238 .BR @IMAGEX_PROGNAME@ (1)
239 .BR @IMAGEX_PROGNAME@-apply (1)
240 .BR @IMAGEX_PROGNAME@-dir (1)
241 .BR @IMAGEX_PROGNAME@-info (1)
242 .BR @IMAGEX_PROGNAME@-mount (1)