OSDN Git Service

move chm dir
[sevenzip/7-Zip.git] / sevenzip.sourceforge.jp / chm / cmdline / syntax.htm
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\r
2 <HTML>\r
3 <HEAD>\r
4   <META http-equiv="Content-Type" content="text/html; charset=Windows-1252">\r
5   <TITLE>Command Line Syntax</TITLE>\r
6   <LINK href="style.css" rel="stylesheet" type="text/css">\r
7 </HEAD>\r
8 \r
9 <BODY>\r
10 \r
11 <H1>Command Line Syntax</H1>\r
12 \r
13 <PRE class = "syntax">\r
14 7z <A href = "commands/index.htm">&lt;command></A> [<A href = "switches/index.htm">&lt;switch></A>...] &lt;base_archive_name> [&lt;arguments>...]\r
15 </PRE>\r
16 <PRE class = "syntax">\r
17 &lt;arguments> ::= <A href = "switches/index.htm">&lt;switch></A> | &lt;wildcard> | &lt;filename> | &lt;list_file>\r
18 <A href = "switches/index.htm">&lt;switch></A>::= &lt;switch_symbol>&lt;switch_characters>[&lt;option>]\r
19 &lt;switch_symbol> ::= '/' | '-' \r
20 &lt;list_file> ::= @{filename}\r
21 </PRE>\r
22 \r
23 \r
24 <P>Expressions in square brackets (between '[' and ']') are optional.</P>\r
25 \r
26 <P>Expressions in curly braces ('{' and '}') mean that instead of that \r
27 Expression (including braces), the user must substitute some string.</P>\r
28 \r
29 <P>Expression</P>\r
30 \r
31 <PRE class = "syntax">\r
32 expression1 | expression2 | ... | expressionN</DT>\r
33 </PRE>\r
34 \r
35 <P>\r
36 means that any (but only one) from these expressions must be specified.\r
37 \r
38 <P><A href = "commands/index.htm">Commands</A> and\r
39 <A href = "switches/index.htm">switches</A> can be entered in upper or lower case.</P>\r
40 \r
41 <P>Command is the first non-switch argument.</P>\r
42 \r
43 <P>The "base_archive_name" must be the first filename on the command line\r
44 after the command.</P>\r
45 \r
46 <P>The switches and other filenames can be in any order.</P>\r
47 \r
48 <P>Wildcards or filenames with spaces must be quoted:</P>\r
49 \r
50 <PRE>\r
51     "Dir\Program files\*"\r
52     Dir\"Program files"\*\r
53 </PRE>\r
54 \r
55 <P>Switch options can be combined to save command line length. However, some\r
56 switch options take optional string arguments and therefore, must be the\r
57 last option in a combined argument token string because 7-Zip accepts the\r
58 rest of the argument token as the optional argument.</P>\r
59 \r
60 <P>7-Zip uses wild name matching similar to Windows 95:</P>\r
61 <UL>\r
62   <LI><B>'*'</B> means a sequence of arbitrary characters.</LI>\r
63   <LI><B>'?'</B> means any character.</LI>\r
64 </UL>\r
65 \r
66 <P><B>\r
67 7-Zip doesn't uses the system wildcard parser.   7-Zip doesn't\r
68 follow the archaic rule by which *.* means any file. 7-Zip treats\r
69 *.* as matching the name of any file that has an extension. To process all files, you must\r
70 use a * wildcard.</B></P>\r
71 \r
72 <P>Examples:</P>\r
73 <TABLE border = "0">\r
74   <TR><TD>*.txt</TD><TD>means all files with an extension of ".txt"</TD></TR>\r
75   <TR><TD>?a*</TD><TD>means all files with a second character of "a"</TD></TR>\r
76   <TR><TD>*1*</TD><TD>means all names that contains character "1"</TD></TR>\r
77   <TR><TD>*.*.*</TD><TD>means all names that contain two at least "." characters</TD></TR>\r
78 </TABLE>\r
79 \r
80 \r
81 <P>The default wildcard "*" will be used if there is no filename/wildcard in the\r
82 command line.</P>\r
83 \r
84 <P>Slash ('\') at the end of a path means a directory. Without a Slash ('\') at\r
85 the end of the path, the path can refer either to a file or a directory.\r
86 \r
87 \r
88 <H2><A name = "ListFile"></A>List file</H2>\r
89 \r
90 <P>You can supply one or more filenames or wildcards for special list files\r
91 (files containing lists of files). The filenames in such list file must be\r
92 separated by new line symbol(s).</P>\r
93 \r
94 <P>For list files, 7-Zip uses UTF-8 encoding by default. You can change encoding\r
95 using <A href = "switches/charset.htm">-scs</A> switch.</P>\r
96 \r
97 <P>Multiple list files are supported.</P>\r
98 \r
99 <P>For example, if the file "listfile.txt" contains the following:</P>\r
100 \r
101 <PRE>\r
102     My programs\*.cpp\r
103     Src\*.cpp\r
104 </PRE>\r
105 <P>then the command</P>\r
106 \r
107 <PRE>\r
108     7z a -tzip archive.zip @listfile.txt\r
109 </PRE>\r
110 \r
111 <P>adds to the archive "archive.zip" all "*.cpp" files from directories "My\r
112 programs" and "Src".</P>\r
113 \r
114 <H2><A name = "ListFile"></A>Short and Long File Names</H2>\r
115 \r
116 <P>7-Zip supports short file names  (like FILENA~1.TXT) in some cases. \r
117 However, it's strongly recommended to use only the real (long) file names.</P>\r
118 \r
119 </BODY>\r
120 </HTML>\r