Running Shell Commands in Zeppelin
This section shows you how to access files in your local filesystem and the MapR File System by using shell commands in your Apache Zeppelin notebook.
Prerequisites
About this task
/mapr
and your cluster name is my.cluster.com
.
You can find the name of your cluster in the file
/opt/mapr/conf/mapr-clusters.conf
on your MapR Data Platform cluster.Procedure
-
Create a file of test data in
/tmp
:%sh cat > /tmp/test.data << EOF John,Smith Brian,May Rodger,Taylor John,Deacon Max,Plank Freddie,Mercury Albert,Einstein Fedor,Dostoevsky Lev,Tolstoy Niccolo,Paganini EOF
-
Copy the file to your home directory in the MapR File System (
/user/mapruser1
), and display the contents of the file:%sh cp /tmp/test.data /mapr/my.cluster.com/user/mapruser1 cat /mapr/my.cluster.com/user/mapruser1/test.data
%sh hadoop fs -put /tmp/test.data /user/mapruser1 hadoop fs -cat /user/mapruser1/test.data