Unable to move my files into hdfs

I tried to move my json files into hdfs by using -put command as shown below.
[kkgprest27288@cxln4 training]$ hdfs dfs -put /home/kkgprest27288/training/employee.json /kkfiles
put: Permission denied: user=kkgprest27288, access=WRITE, inode="/kkfiles.COPYING":hdfs:hdfs:drwxr-xr-x

But it says permission denied…

Hi, Raj.
If you are Copying the local file into the directory in HDFS here is the command .

hdfs dfs –copyFromLocal testfile.txt /user/copy_from_local_example

Where
testfile.txt is the file at the Local.
/user/copy_from_local_example --> is the path in the HDFS where you want to copy the file.

All the best!

stayjit,

[kkgprest27288@cxln4 training]$ hdfs dfs -put /home/kkgprest27288/training/employee.json /kkfiles
put: Permission denied: user=kkgprest27288, access=WRITE, inode="/kkfiles. COPYING ":hdfs:hdfs:drwxr-xr-

my question is why it is saying “permission denied”?
I tried to create new directory in hdfs by using following command
hdfs dfs -mkdir /kkfiles
kkfiles diretcory was successfully created. but it was not visible
and then I tried to move the files into kkfiles directory.
it says “permission denied”…
I just want to know what is the reason ?

similar issue i am also facing now, how to create a normal localfile to the HDFS folder. tried multiple times facing . below is the error i am facing

[iragav2006126500@cxln10 ~]$ hadoop fs -copyFromLocal /home/iragav2006126500/spk_log.txt /data_files/spk_log.txt
copyFromLocal: /data_files/spk_log.txt': No such file or directory: hdfs://cxln1.c.thelab-240901.internal:8020/data_files/spk_log.txt’
[iragav2006126500@cxln10 ~]$

in one of the thread sandeep posted that you have to create the folder under the /user/directory not the /home

so basically hadoop fs -put/copyfromlocal /user//destination_filename

This is worked for me

The correct formmated syntax is

hadoop fs -put your_file_name /user/your_username

or

hadoop fs -copyFromLocal your_file_name /user/your_username