hdfs dfs -test -e remote.txt
echo $?
hdfs dfs -appendToFile local.txt remote.txt
hdfs dfs -copyFromLocal -f local.txt remote.txt
hdfs dfs -cp -f file:///home/hadoop/local.txt remote.txt
cat local.txt
hdfs dfs -cat remote.txt
if $(hdfs dfs -test -e remote.txt);
then $(hdfs dfs -appendToFile local.txt remote.txt);
else $(hdfs dfs -copyFromLocal -f local.txt remote.txt);
fi
ls
if $(hdfs dfs -test -e remote.txt);
then $(hdfs dfs -copyToLocal remote.txt ./remote2.txt);
else $(hdfs dfs -copyToLocal remote.txt ./remote.txt);
fi
ls
hdfs dfs -cat remote.txt
hdfs dfs -ls -h remote.txt
hdfs dfs -ls -R -h /user/weiwanling
hdfs dfs -ls
if $(hdfs dfs -test -d dir1/dir2);
then $(hdfs dfs -touchz dir1/dir2/filename);
else $(hdfs dfs -mkdir -p dir1/dir2 && hdfs dfs -touchz dir1/dir2/filename);
fi
hdfs dfs -ls
hdfs dfs -rm dir1/dir2/filename
hdfs dfs -ls
hdfs dfs -mkdir -p dir1/dir2
hdfs dfs -rmdir dir1/dir2
hdfs dfs -rm -R dir1/dir2
hdfs dfs -appendToFile local.txt remote.txt
hdfs dfs -cat remote.txt
hdfs dfs -get -f remote.txt
cat remote.txt local.txt > remote1.txt
hdfs dfs -copyFromLocal -f remote1.txt remote.txt
hdfs dfs -cat remote.txt
hdfs dfs -rm remote.txt
hdfs dfs -mv remote.txt remote2.txt