All Products
Search
Document Center

Object Storage Service:Use Jindo CLI commands to access OSS-HDFS

Last Updated:Mar 20, 2026

Jindo CLI (jindo fs) lets you run file-system operations — upload, download, list, delete, and more — against an OSS-HDFS-enabled bucket directly from the command line. The jindo fs interface mirrors the familiar hadoop fs shell, so existing Hadoop workflows apply directly.

Prerequisites

Before you begin, make sure that you have:

  • An OSS bucket with OSS-HDFS enabled

  • One of the following environments set up:

Configure the environment (non-EMR only)

Skip this section if you are using an EMR cluster — the required configuration is already in place.

For non-EMR environments, complete the following steps.

  1. Connect to your ECS instance. For details, see Connect to an ECS instance.

  2. Go to the bin directory of the installed JindoSDK JAR file.

       cd jindosdk-x.x.x/bin/

    Replace x.x.x with your installed JindoSDK version number.

  3. Create a configuration file named jindosdk.cfg with the following content.

       [common]
       logger.dir = /tmp/jindo/
       logger.sync = false
       logger.consolelogger = false
       logger.level = 0
       logger.verbose = 0
       logger.cleaner.enable = true
       hadoopConf.enable = false
    
       [jindosdk]
       # Replace with the endpoint for your region
       fs.oss.endpoint = cn-hangzhou.oss-dls.aliyuncs.com
       fs.oss.accessKeyId = yourAccessKeyId
       fs.oss.accessKeySecret = yourAccessKeySecret

    The example above uses the China (Hangzhou) region. Replace cn-hangzhou.oss-dls.aliyuncs.com with the endpoint for your actual region. The endpoint format for OSS-HDFS is <region-id>.oss-dls.aliyuncs.com.

  4. Set the JINDOSDK_CONF_DIR environment variable to the absolute path of the jindosdk.cfg configuration file.

       export JINDOSDK_CONF_DIR=<JINDOSDK_CONF_DIR>

Run Jindo CLI commands

All commands below run from the bin directory of your JindoSDK installation. OSS-HDFS paths use the following format:

oss://<bucket-name>.<region-endpoint>/<path>

The following table summarizes the available operations.

OperationCommand flagExample
Upload a file-put./jindo fs -put examplefile.txt oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com/
Create a directory-mkdir./jindo fs -mkdir oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com/dir/
List objects or directories-ls./jindo fs -ls oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com/
Query object or directory sizes-du./jindo fs -du oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com/
Read object content-cat./jindo fs -cat oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com/localfile.txt
Download a file-get./jindo fs -get oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com/exampleobject.txt /tmp/
Delete directories or objects-rm -r./jindo fs -rm -r oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com/destfolder/

Upload a file

Upload a local file to a bucket.

./jindo fs -put examplefile.txt oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com/

This uploads examplefile.txt from the local root directory to the root of examplebucket.

Create a directory

./jindo fs -mkdir oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com/dir/

This creates a directory named dir/ in examplebucket.

List objects or directories

./jindo fs -ls oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com/

This lists all objects and directories in the root of examplebucket.

Query object or directory sizes

./jindo fs -du oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com/

This displays the size of every object and directory in examplebucket.

Read object content

./jindo fs -cat oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com/localfile.txt

This prints the content of localfile.txt to stdout as plain text.

Important

Content is always output as plain text. If the object is encoded or binary, use HDFS API for Java to read and decode it.

Download a file

./jindo fs -get oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com/exampleobject.txt /tmp/

This downloads exampleobject.txt from examplebucket to /tmp/ on your local machine.

Delete directories or objects

./jindo fs -rm -r oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com/destfolder/

The -r flag deletes destfolder/ and all objects inside it recursively.

What's next