Is there ln -s
in hadoop HDFS?
For instance:
I have 10 files in HDFS
/user/hadoop/input
, which is 1.txt, 2.txt ... 10.txt
Another dir in HDFS is /user/hadoop/test
I just wanna copy 1 file from /user/hadoop/input/1.txt
to /user/hadoop/test/1.txt
.
The simplest way is use hadoop dfs -cp /user/hadoop/1.txt /user/hadoop/test
.
But it cost more time and disk space. Is there a way like shell such as hadoop dfs -ln /user/hadoop/1.txt /user/hadoop/test/1.txt
?
HDFS supports Symbolic links. Check 1, 2, 3, 4 for more details. So, it can be done using Java API, but never came across a CLI for the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With