All Products
Search
Document Center

E-MapReduce:Use Jindo CLI commands to access OSS or OSS-HDFS

Last Updated:Mar 27, 2026

Jindo CLI lets you manage files in Object Storage Service (OSS) and OSS-HDFS from the command line—uploading, downloading, listing, and deleting objects without writing any code.

Prerequisites

Before you begin, ensure that you have:

  • In an E-MapReduce (EMR) environment: JindoSDK is pre-installed. No additional setup is required.

    • To access OSS-HDFS, use EMR V3.44.0 or later, or EMR V5.10.0 or later.

  • In a non-EMR environment: Deploy JindoSDK before running any commands.

    • To access OSS-HDFS, install JindoSDK V4.6.X or later.

Commands

All Jindo CLI file system commands use the jindo fs prefix. Jindo CLI commands work identically for OSS and OSS-HDFS. The only difference is the endpoint in the path.

Upload a file

jindo fs -put <local-file> <oss-path>

Upload examplefile.txt from the local root directory to a bucket named examplebucket in OSS-HDFS:

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

Create a directory

jindo fs -mkdir <oss-path>

Create a directory named dir/ in examplebucket:

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

List files and directories

jindo fs -ls <oss-path>

List all files and directories in examplebucket:

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

Check sizes

jindo fs -du <oss-path>

Show the size of all files and directories in examplebucket:

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

View file content

jindo fs -cat <oss-path>

Print the content of localfile.txt to stdout:

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

The content is displayed as plain text. If the file is encoded, use the Hadoop Distributed File System (HDFS) API for Java to read and decode it.

Download a file

jindo fs -get <oss-path> <local-path>

Download exampleobject.txt from examplebucket to /tmp/ on your local machine:

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

Delete files or directories

jindo fs -rm <oss-path>

Delete the directory destfolder/ and all its contents from examplebucket:

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

What's next

For the full list of supported commands and options, see Use Jindo CLI.