Hadoop handy commands
1. To know which Hadoop version is installed
$] hadoop version
2. To list the contents present in HDFS
$] hadoop fs -ls/ hdfs fs -ls
3.To create a new directory in HDFS
$] hadoop fs -mkdir <your/desired/location/path>/ hdfs dfs -mkdir <your/desired/location/path>
4. To list the contents present in HDFS directory
$] hadoop fs -ls <your/desired/location/path>/ hdfs dfs -ls <your/desired/location/path>
5. This command moves file(s) from source to destination
$] hadoop fs -mv <your/source> <your/destination>/ hdfs dfs -mv <your/source> <your/destination>
6. This command copies file from local machine and paste in the given HDFS directory
$] hadoop fs -copyFromLocal <your/local/source> <your/HDFS/source>/
hdfs dfs -copyFromLocal <your/local/source> <your/HDFS/source>
7. This command copies file from HDFS directory to local machine and paste them there.
$] hadoop fs -copyToLocal <your/HDFS/source> <your/local/source>
hdfs dfs -copyToLocal <your/HDFS/source> <your/local/source>
8. This command will empty the trash.
$] hadoop fs -expunge/ hdfs dfs -expunge
$] hadoop version
2. To list the contents present in HDFS
$] hadoop fs -ls/ hdfs fs -ls
3.To create a new directory in HDFS
$] hadoop fs -mkdir <your/desired/location/path>/ hdfs dfs -mkdir <your/desired/location/path>
4. To list the contents present in HDFS directory
$] hadoop fs -ls <your/desired/location/path>/ hdfs dfs -ls <your/desired/location/path>
5. This command moves file(s) from source to destination
$] hadoop fs -mv <your/source> <your/destination>/ hdfs dfs -mv <your/source> <your/destination>
6. This command copies file from local machine and paste in the given HDFS directory
$] hadoop fs -copyFromLocal <your/local/source> <your/HDFS/source>/
hdfs dfs -copyFromLocal <your/local/source> <your/HDFS/source>
7. This command copies file from HDFS directory to local machine and paste them there.
$] hadoop fs -copyToLocal <your/HDFS/source> <your/local/source>
hdfs dfs -copyToLocal <your/HDFS/source> <your/local/source>
8. This command will empty the trash.
$] hadoop fs -expunge/ hdfs dfs -expunge
Comments
Post a Comment