Showing posts with label extract file list from Hadoop. Show all posts
Showing posts with label extract file list from Hadoop. Show all posts

Tuesday, June 16, 2015

Extract All Tar Files in a directory in Linux

This will first list the files containing extension tar.gz, and then awk will get the file names which is column 9 in

ls -lrth command, and

NF > 2 will remove the blank line and

tar -xvzf will extract files names contained in variable $i,

Like this we can experiment various operations like renaming all files with specific extension of so and can fiddled with to achieve various goals.


for i in `ls -lrth *.tar.gz |awk  'NF>2 {print $9}'`; do tar -xvzf $i; done

Wednesday, May 22, 2013

Better way to get a list of all files on Hadoop, using shell.





Hadoop provides an option OIV  that is offline image viewer, which can read the Hadoop image file and output it to a output file in human readable format.


Syntax and uses:


bin/hadoop  oiv –i <Hadoop image file name> -o <output file in human readable form>


Options with this command:


There is an additional option to output file format that is defined using switch –p <format>, the formats can be: -->
 

Featured Posts

Run Commands for Windows

  🖥️ CPL Files (Control Panel Applets) Run via Win + R → filename.cpl Command Opens appwiz.cpl P...