tar command

tar -tvf filename to list out all files.
tar -zcvf ../sponge-flume-ng.tar.gz .
tar -zcvf ../sponge-flume-ng.tar.gz . –exclude=”jenkins”
tar -zcvf /opt/flume-agent.tar.gz .
tar -zcvf /opt/flume-agent.tar.gz . –exclude=”jenkins”

tar -zxvf /home/mohan/flume-ng-1.2.0-cdh4.1.2.tar.gz apache-flume-1.2.0-cdh4.1.2/bin apache-flume-1.2.0-cdh4.1.2/conf apache-flume-1.2.0-cdh4.1.2/lib
tar -cvf /tmp/apsconf.tar –exclude=”modules” –exclude=”logsconf” /opt/myappconf/myapps/console/config/conf
tar -cvf /tmp/myappconf.tar –exclude=”modules” –exclude=”logsconf” /opt/myappconf/myapps/console/config/conf
tar -cvf /tmp/myappconf.tar /opt/myappconf/myapps/console/config/conf

Example:
tar -zcvf /tmp/mybackup.tar.gz –exclude=’abc’ –exclude=’xyz’ /home/me

Advertisements