Help Center> Object Storage Service> Tool Guide (obsutil) (Paris Region)> FAQs> Can I Use obsutil to Directly Save a Listing Result to a Local File?
Updated on 2022-05-18 GMT+08:00

Can I Use obsutil to Directly Save a Listing Result to a Local File?

obsutil does not allow you to directly save a listing result to a local file, but you can redirect a listing result in standard output to a specified local file by relying on the redirection supported by OS.

  • In Windows, run the following redirection command in the CLI:
    obsutil ls obs://bucketName -format=default -limit=0 > D:/result.txt
  • In Linux or macOS, run the following command:
    ./obsutil ls obs://bucketName -format=default -limit=0 > /root/result.txt

    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.