forked from docs/doc-exports
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com> Co-authored-by: weihongmin1 <weihongmin1@huawei.com> Co-committed-by: weihongmin1 <weihongmin1@huawei.com>
45 lines
3.0 KiB
HTML
45 lines
3.0 KiB
HTML
<a name="obs_11_0031"></a><a name="obs_11_0031"></a>
|
|
|
|
<h1 class="topictitle1">Listing</h1>
|
|
<div id="body1543383727788"><p id="obs_11_0031__p9795101319301">All commands in this section use the Linux operating system as an example to describe how to list files.</p>
|
|
<p id="obs_11_0031__p0386153185616">Assume that bucket <strong id="obs_11_0031__b12714011584">bucket-test</strong> contains the following objects:</p>
|
|
<pre class="screen" id="obs_11_0031__screen776818585566">obs://bucket-test/test1.txt
|
|
obs://bucket-test/test2.txt
|
|
obs://bucket-test/test3.txt
|
|
obs://bucket-test/test4.txt
|
|
obs://bucket-test/test5.txt
|
|
obs://bucket-test/test6.txt
|
|
obs://bucket-test/src1/
|
|
obs://bucket-test/src1/test7.txt
|
|
obs://bucket-test/src2/
|
|
obs://bucket-test/src2/test8.txt</pre>
|
|
<p id="obs_11_0031__p6890155720220">Based on the structure of objects in the bucket, different object listing scenarios require different commands.</p>
|
|
<ul id="obs_11_0031__ul174731818476"><li id="obs_11_0031__li97601771879">To list three objects in bucket <strong id="obs_11_0031__b10740311310">bucket-test</strong>, the command is as follows:<pre class="screen" id="obs_11_0031__screen663013515912">./obsutil ls obs://bucket-test -limit=3</pre>
|
|
<p id="obs_11_0031__p163819424915">The returned result is listed in lexicographical order by object name and version ID as follows:</p>
|
|
<pre class="screen" id="obs_11_0031__screen1413213287128">obs://bucket-test/test1.txt
|
|
obs://bucket-test/test2.txt
|
|
obs://bucket-test/test3.txt</pre>
|
|
</li><li id="obs_11_0031__li63641711819">To list three objects following <strong id="obs_11_0031__b49378207255">test3.txt</strong> in bucket <strong id="obs_11_0031__b169781540112311">bucket-test</strong>, the command is as follows:<pre class="screen" id="obs_11_0031__screen16647138191720">./obsutil ls obs://bucket-test -limit=3 -marker=test3.txt</pre>
|
|
<p id="obs_11_0031__p338414270177">The returned result is listed in lexicographical order by object name and version ID as follows:</p>
|
|
<pre class="screen" id="obs_11_0031__screen9165534181813">obs://bucket-test/test4.txt
|
|
obs://bucket-test/test5.txt
|
|
obs://bucket-test/test6.txt</pre>
|
|
</li><li id="obs_11_0031__li6423193851816">To list the files and subdirectories in the root directory of bucket <strong id="obs_11_0031__b11694201513294">bucket-test</strong> in non-recursive mode, that is, files in the subdirectories are not listed, the command is as follows:<pre class="screen" id="obs_11_0031__screen5833109165713">./obsutil ls obs://bucket-test -d</pre>
|
|
<p id="obs_11_0031__p7917133819528">The returned result is listed in lexicographical order by object name and version ID as follows:</p>
|
|
<pre class="screen" id="obs_11_0031__screen1534182520569">obs://bucket-test/test1.txt
|
|
obs://bucket-test/test2.txt
|
|
obs://bucket-test/test3.txt
|
|
obs://bucket-test/test4.txt
|
|
obs://bucket-test/test5.txt
|
|
obs://bucket-test/test6.txt
|
|
obs://bucket-test/src1/
|
|
obs://bucket-test/src2/</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_11_0027.html">Common Examples</a></div>
|
|
</div>
|
|
</div>
|
|
|