First you have to become hdfs user as shown in guide.
Command: sudo su hdfs
Now use the command:
hadoop dfs -copyFromLocal wordcountproblem hdfs:/
hadoop command is deprecated but it will work.
Standard command:
hdfs dfs -copyFromLocal wordcountproblem hdfs:/