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>
51 lines
5.9 KiB
HTML
51 lines
5.9 KiB
HTML
<a name="obs_11_0006"></a><a name="obs_11_0006"></a>
|
|
|
|
<h1 class="topictitle1">Quick Start</h1>
|
|
<div id="body1543223109231"><p id="obs_11_0006__p139221232154714">This section uses the Linux OS as an example to describe how to use obsutil to perform basic operations in OBS. For details, see .</p>
|
|
<div class="section" id="obs_11_0006__section16839141103914"><h4 class="sectiontitle">Prerequisites</h4><ul id="obs_11_0006__ul5731242256"><li id="obs_11_0006__li67313421456">You have obtained obsutil and completed <a href="obs_11_0005.html">initial configuration</a>.</li><li id="obs_11_0006__li167459436511">The directory saving obsutil is accessed.</li></ul>
|
|
</div>
|
|
<div class="section" id="obs_11_0006__section135809001613"><h4 class="sectiontitle">Procedure</h4><ol id="obs_11_0006__ol3968102411523"><li id="obs_11_0006__li396882414524"><span>Run the <strong id="obs_11_0006__b5989104805118">./obsutil mb obs://bucket-test</strong> command to create a bucket named <strong id="obs_11_0006__b132621652192518">bucket-test</strong> in the region.</span><p><pre class="screen" id="obs_11_0006__screen13835524185118"><strong id="obs_11_0006__b69984416325">./obsutil mb obs://bucket-test</strong>
|
|
|
|
Create bucket [bucket-test] successfully!</pre>
|
|
</p></li><li id="obs_11_0006__li09681624125214"><span>Run the <strong id="obs_11_0006__b1023912618181">./obsutil cp /temp/test.txt obs://bucket-test/test.txt</strong> command to upload the <strong id="obs_11_0006__b1510114622715">test.txt</strong> file to bucket <strong id="obs_11_0006__b0427175619278">bucket-test</strong>.</span><p><pre class="screen" id="obs_11_0006__screen11498175213334"><strong id="obs_11_0006__b1596785533418">./obsutil cp /temp/test.txt obs://bucket-test/test.txt</strong>
|
|
|
|
Parallel: 5 Jobs: 5
|
|
Threshold: 52428800 PartSize: 5242880
|
|
VerifyLength: false VerifyMd5: false
|
|
CheckpointDir: /temp/.obsutil_checkpoint
|
|
|
|
test.txt:[==============================================] 100.00% 48.47 KB/s 0s
|
|
Upload successfully, 4.44KB, /temp/test.txt --> obs://bucket-test1/test.txt</pre>
|
|
<div class="note" id="obs_11_0006__note1277380127"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="obs_11_0006__p137733019215">To upload local folder <strong id="obs_11_0006__b133117369333">test</strong> to the OBS bucket, run the following command:</p>
|
|
<pre class="screen" id="obs_11_0006__screen25741116634"><strong id="obs_11_0006__b135749165315">./obsutil cp /test/ obs://bucket-test -r -f</strong></pre>
|
|
<ul id="obs_11_0006__ul10521171019720"><li id="obs_11_0006__li769210121774">For details about the <strong id="obs_11_0006__b14434115212341">cp</strong> command, see <a href="obs_11_0013.html">Uploading an Object</a>.</li><li id="obs_11_0006__li95215101178">For more upload scenarios, see <a href="obs_11_0028.html">Upload</a>.</li></ul>
|
|
</div></div>
|
|
</p></li><li id="obs_11_0006__li149681624135218"><span>Run the <strong id="obs_11_0006__b73482127375">./obsutil cp obs://bucket-test/test.txt</strong> <strong id="obs_11_0006__b11350312103713">/temp/test1.txt</strong> command to download <strong id="obs_11_0006__b16843916143018">test.txt</strong> from bucket <strong id="obs_11_0006__b141083673016">bucket-test</strong> to a local PC.</span><p><pre class="screen" id="obs_11_0006__screen58581878364"><strong id="obs_11_0006__b26051549113611">./obsutil cp obs://bucket-test/test.txt</strong> <strong id="obs_11_0006__b36064490365">/temp/test1.txt</strong>
|
|
|
|
Parallel: 5 Jobs: 5
|
|
Threshold: 52428800 PartSize: 5242880
|
|
VerifyLength: false VerifyMd5: false
|
|
CheckpointDir: /temp/.obsutil_checkpoint
|
|
|
|
test.txt:[=============================================] 100.00% 775.52 KB/s 0s
|
|
Download successfully, 4.44KB, obs://bucket-test1/test.txt --> /temp/test1.txt</pre>
|
|
<div class="note" id="obs_11_0006__note453713311673"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="obs_11_0006__p1853711313713">To download directory <strong id="obs_11_0006__b3196201283814">test</strong> from the OBS bucket to the local folder <strong id="obs_11_0006__b19862630183810">temp</strong>, run the following command:</p>
|
|
<pre class="screen" id="obs_11_0006__screen16537931977"><strong id="obs_11_0006__b20537143119710">./obsutil cp obs://bucket-test/test /temp -r -f</strong></pre>
|
|
<ul id="obs_11_0006__ul353720312717"><li id="obs_11_0006__li1537183111716">For details about the <strong id="obs_11_0006__b3311626153917">cp</strong> command, see <a href="obs_11_0018.html">Downloading an Object</a>.</li><li id="obs_11_0006__li195374319716">For more download scenarios, see <a href="obs_11_0029.html">Download</a>.</li></ul>
|
|
</div></div>
|
|
</p></li><li id="obs_11_0006__li496812412526"><span>Run the <strong id="obs_11_0006__b457411313143">./obsutil rm obs://bucket-test/test.txt -f</strong> command to delete object <strong id="obs_11_0006__b208272459284">test.txt</strong> from bucket <strong id="obs_11_0006__b274119014294">bucket-test</strong>.</span><p><pre class="screen" id="obs_11_0006__screen114888144011"><strong id="obs_11_0006__b1946843954010">./obsutil rm obs://bucket-test/test.txt -f</strong>
|
|
|
|
Delete object [test.txt] in the bucket [bucket-test] successfully!</pre>
|
|
</p></li><li id="obs_11_0006__li17968172415521"><span>Run the <strong id="obs_11_0006__b1749332852013">./obsutil rm obs://bucket-test -f</strong> command to delete bucket <strong id="obs_11_0006__b14667152719299">bucket-test</strong>.</span><p><pre class="screen" id="obs_11_0006__screen3490488402"><strong id="obs_11_0006__b12402257144012">./obsutil rm obs://bucket-test -f</strong>
|
|
|
|
Delete bucket [bucket-test] successfully!</pre>
|
|
</p></li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_11_0002.html">Getting Started</a></div>
|
|
</div>
|
|
</div>
|
|
|