Adding a header to an existing file:
echo -e "field1,field2,field3,field4,field5" | cat - test.csv > /tmp/tempFile && mv /tmp/tempFile test.csv
grep a file with wild card in the search string
grep "08/../2010" test.csv
Delete a line from a file matching a search string
sed -i.bak '/search string/d' file
Delete first line from the file
sed '1d' file.txt > tmpfile; mv tmpfile file.txt
Starting Hive session with Tez execution engine
hive --hiveconf hive.execution.engine=Tez
Installing artifact into maven repository
echo -e "field1,field2,field3,field4,field5" | cat - test.csv > /tmp/tempFile && mv /tmp/tempFile test.csv
grep a file with wild card in the search string
grep "08/../2010" test.csv
Delete a line from a file matching a search string
sed -i.bak '/search string/d' file
Delete first line from the file
sed '1d' file.txt > tmpfile; mv tmpfile file.txt
Starting Hive session with Tez execution engine
hive --hiveconf hive.execution.engine=Tez
Installing artifact into maven repository
mvn install:install-file -DgroupId=jdk.tools -DartifactId=jdk.tools -Dpackaging=jar -Dversion=1.6 -Dfile=tools.jar -DgeneratePom=true
Installing Java 8 on centos
su -c "yum install java-1.8.0-openjdk"
Updating JAVA_HOME
sudo gedit .bash_profile
Add JAVA_HOME=/usr/lib/jvm/java-1.8.0/jre
Update java -version
sudo vi .bashrc
Add PATH=
/usr/lib/jvm/java-1.8.0/jre/bin:$PATH