Wednesday, 23 March 2022

Hadoop: ls: print file paths only

 ‘ls’ command print file paths, along with size, owner and group of the file by default.

$hadoop fs -ls /user
Found 8 items
drwxr-xr-x   - cloudera cloudera            0 2022-03-22 23:48 /user/cloudera
drwxr-xr-x   - mapred   hadoop              0 2017-10-23 09:15 /user/history
drwxrwxrwx   - hive     supergroup          0 2017-10-23 09:17 /user/hive
drwxrwxrwx   - hue      supergroup          0 2017-10-23 09:16 /user/hue
drwxrwxrwx   - jenkins  supergroup          0 2017-10-23 09:15 /user/jenkins
drwxrwxrwx   - oozie    supergroup          0 2017-10-23 09:16 /user/oozie
drwxrwxrwx   - root     supergroup          0 2017-10-23 09:16 /user/root
drwxr-xr-x   - hdfs     supergroup          0 2017-10-23 09:17 /user/spark

Use the option -C, if you are interested only in file paths.

$hadoop fs -ls -C /user
/user/cloudera
/user/history
/user/hive
/user/hue
/user/jenkins
/user/oozie
/user/root
/user/spark




 

 

Previous                                                 Next                                                 Home

No comments:

Post a Comment