OLD | NEW |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 # Copyright 2012 Google Inc. All Rights Reserved. | 2 # Copyright 2012 Google Inc. All Rights Reserved. |
3 # | 3 # |
4 # Licensed under the Apache License, Version 2.0 (the "License"); | 4 # Licensed under the Apache License, Version 2.0 (the "License"); |
5 # you may not use this file except in compliance with the License. | 5 # you may not use this file except in compliance with the License. |
6 # You may obtain a copy of the License at | 6 # You may obtain a copy of the License at |
7 # | 7 # |
8 # http://www.apache.org/licenses/LICENSE-2.0 | 8 # http://www.apache.org/licenses/LICENSE-2.0 |
9 # | 9 # |
10 # Unless required by applicable law or agreed to in writing, software | 10 # Unless required by applicable law or agreed to in writing, software |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 [char range] | 91 [char range] |
92 Match any of the range of characters. For example | 92 Match any of the range of characters. For example |
93 "gs://bucket/[a-m].txt" matches objects that contain letters | 93 "gs://bucket/[a-m].txt" matches objects that contain letters |
94 a, b, c, ... or m, and end with .txt. | 94 a, b, c, ... or m, and end with .txt. |
95 | 95 |
96 You can combine wildcards to provide more powerful matches, for example: | 96 You can combine wildcards to provide more powerful matches, for example: |
97 | 97 |
98 gs://bucket/[a-m]??.j*g | 98 gs://bucket/[a-m]??.j*g |
99 | 99 |
100 | 100 |
| 101 <B>DIFFERENT BEHAVIOR FOR "DOT" FILES IN LOCAL FILE SYSTEM</B> |
| 102 Per standard Unix behavior, the wildcard "*" only matches files that don't |
| 103 start with a "." character (to avoid confusion with the "." and ".." |
| 104 directories present in all Unix directories). gsutil provides this same |
| 105 behavior when using wildcards over a file system URI, but does not provide |
| 106 this behavior over cloud URIs. For example, the following command will copy |
| 107 all objects from gs://bucket1 to gs://bucket2: |
| 108 |
| 109 gsutil cp gs://bucket1/* gs://bucket2 |
| 110 |
| 111 but the following command will copy only files that don't start with a "." |
| 112 from the directory "dir" to gs://bucket1: |
| 113 |
| 114 gsutil cp dir/* gs://bucket1 |
| 115 |
| 116 |
101 <B>EFFICIENCY CONSIDERATION: USING WILDCARDS OVER MANY OBJECTS</B> | 117 <B>EFFICIENCY CONSIDERATION: USING WILDCARDS OVER MANY OBJECTS</B> |
102 It is more efficient, faster, and less network traffic-intensive | 118 It is more efficient, faster, and less network traffic-intensive |
103 to use wildcards that have a non-wildcard object-name prefix, like: | 119 to use wildcards that have a non-wildcard object-name prefix, like: |
104 | 120 |
105 gs://bucket/abc*.txt | 121 gs://bucket/abc*.txt |
106 | 122 |
107 than it is to use wildcards as the first part of the object name, like: | 123 than it is to use wildcards as the first part of the object name, like: |
108 | 124 |
109 gs://bucket/*abc.txt | 125 gs://bucket/*abc.txt |
110 | 126 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 185 |
170 # Help specification. See help_provider.py for documentation. | 186 # Help specification. See help_provider.py for documentation. |
171 help_spec = HelpProvider.HelpSpec( | 187 help_spec = HelpProvider.HelpSpec( |
172 help_name='wildcards', | 188 help_name='wildcards', |
173 help_name_aliases=['wildcard', '*', '**'], | 189 help_name_aliases=['wildcard', '*', '**'], |
174 help_type='additional_help', | 190 help_type='additional_help', |
175 help_one_line_summary='Wildcard Names', | 191 help_one_line_summary='Wildcard Names', |
176 help_text=_DETAILED_HELP_TEXT, | 192 help_text=_DETAILED_HELP_TEXT, |
177 subcommand_help_text={}, | 193 subcommand_help_text={}, |
178 ) | 194 ) |
OLD | NEW |