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>
17 lines
1.5 KiB
HTML
17 lines
1.5 KiB
HTML
<a name="obs_11_0076"></a><a name="obs_11_0076"></a>
|
|
|
|
<h1 class="topictitle1">Can I Use obsutil to Directly Save a Listing Result to a Local File?</h1>
|
|
<div id="body0000001200906207"><p id="obs_11_0076__p8060118">obsutil does not allow you to directly save a listing result to a local file, but you can redirect a listing result displayed on the screen in standard output to a specified local file by relying on the redirection supported by OS. The following uses the listing of objects in a bucket as an example:</p>
|
|
<ul id="obs_11_0076__ul2950115205117"><li id="obs_11_0076__li6950185115115">In Windows, run the following redirection command in the CLI:<pre class="screen" id="obs_11_0076__screen1958815248519">obsutil ls obs://bucketName -limit=0 > D:/result.txt</pre>
|
|
</li><li id="obs_11_0076__li89590910517">In Linux or macOS, run the following command:<pre class="screen" id="obs_11_0076__screen20249153517525">./obsutil ls obs://bucketName -limit=0 > /root/result.txt</pre>
|
|
<div class="note" id="obs_11_0076__note5829822175513"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="obs_11_0076__p88295227557">In Windows, you need to perform the redirection operation in the CLI to redirect the output to a local file. Do not run the redirection command in the obsutil executable file because obsutil does not support redirection.</p>
|
|
</div></div>
|
|
</li></ul>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_11_0074.html">FAQs</a></div>
|
|
</div>
|
|
</div>
|
|
|