Tuesday, December 29, 2015

Is there any way get free movie tickets with out any deals ?

Is there any way get free movie tickets with out any deals ?


        
       The answer for the above question is slightly no before Break My Show started. This site have huge collection of Movie tickets. 

This site solved the basic use case of movie lovers. There lot more websites are available movie tickets online but none of them are not interested that provide cancellation of the tickets. The user who want's to cancel their tickets due to several reason they will not hear them because providing cancellation option extra pain for them as I mention in my earlier blog. Here comes to the solution of this type of problem was addressed by Break My Show

Why Break My Show ?


Its addressed the below use cases which are un-answered by rest of the world.
  • Book your ticket and plan your date, don't worry about cancellation. (Break My Show will take care)
  • Sudden plan can effect two ways.
    • It tends to cancel your planned movie tickets
    • It tends you to book tickets at last time.
  • If you planned to go movie in last minute here is the plat form to get Low price tickets at your desired location 
  • If you are waiting for FREE movie tickets with out any deals or any offers then Break My Show is only one place where you can get Low price and FREE movie tickets for any movie across the India. 


Monday, December 28, 2015

How do I cancel my movie tickets ? My plan changed in last minute

             It's common nowadays, people plan their events and some time unable to make it.

What are the common problem people drop in last minute ?

  1. Booked movie tickets for wrong date
  2. Over booked the move tickets tickets
  3. Booked but unable to make it go that particular movie or event. 
  4. No interested before going to movie. 

Why Consumer portals not provide cancellation ? 
  1. For example Book My Show allow ticket cancellation it would be very great help but functionality the won't give that option.
  2. The reason why they won't able to provide that option is, they have give the money back to customer and try to sell the tickets again. Both the cases not simple as I typed here.
  3. Compare any online movie tickets portal, like Easy Movies, just tickets, tickets please .. etc any other site they will not give that option to cancel. They won't take any pain once they sold out. 
What is the solution ?
  1. Here comes to the solution and put the pull stop to it. 
  2. Break My Show is the place where you can sell your tickets.
  3. Some how ending up with loss this might be the best solution
  4. Not only selling here. You can get the tickets for lower price compare to actual price 
  5. And also may get a chance to Free tickets some of the kind hearts put it there and then go.

Tuesday, October 21, 2014

Email etiquette

Why do you need email etiquette?

A company needs to implement etiquette rules for the following three reasons:
 Professionalism: by using proper email language your company will convey a professional image.
 Efficiency: emails that get to the point are much more effective than poorly worded emails.
 Protection from liability: employee awareness of email risks will protect your company from costly law suits.

What are the etiquette rules?

There are many etiquette guides and many different etiquette rules. Some rules will differ according to the nature of your business and the corporate culture. Below we list what we consider as the 32 most important email etiquette rules that apply to nearly all companies.
32 most important email etiquette tips:

1. Be concise and to the point.
Do not make an e-mail longer than it needs to be. Remember that reading an e-mail is harder than reading printed communications and a long e-mail can be very discouraging to read.

2. Answer all questions, and pre-empt further questions.
An email reply must answer all questions, and pre-empt further questions – If you do not answer all the questions in the original email, you will receive further e-mails regarding the unanswered questions, which will not only waste your time and your customer’s time but also cause considerable frustration. Moreover, if you are able to pre-empt relevant questions, your customer will be grateful and impressed with your efficient and thoughtful customer service. Imagine for instance that a customer sends you an email asking which credit cards you accept. Instead of just listing the credit card types, you can guess that their next question will be about how they can order, so you also include some order information and a URL to your order page. Customers will definitely appreciate this.

3. Use proper spelling, grammar & punctuation.
This is not only important because improper spelling, grammar and punctuation give a bad impression of your company, it is also important for conveying the message properly. E-mails with no full stops or commas are difficult to read and can sometimes even change the meaning of the text. And, if your program has a spell checking option, why not use it?

4. Make it personal.
Not only should the e-mail be personally addressed, it should also include personal i.e. customized content. For this reason auto replies are usually not very effective. However, templates can be used effectively in this way, see next tip.

5. Use templates for frequently used responses.
Some questions you get over and over again, such as directions to your office or how to subscribe to your newsletter. Save these texts as response templates and paste these into your message when you need them. You can save your templates in a Word document, or use pre-formatted emails. Even better is a tool such as ReplyMate for Outlook (allows you to use 10 templates for free).

6. Answer swiftly.
Customers send an e-mail because they wish to receive a quick response. If they did not want a quick response they would send a letter or a fax. Therefore, each e-mail should be replied to within at least 24 hours, and preferably within the same working day. If the email is complicated, just send an email back saying that you have received it and that you will get back to them. This will put the customer's mind at rest and usually customers will then be very patient!

7. Do not attach unnecessary files.
By sending large attachments you can annoy customers and even bring down their e-mail system. Wherever possible try to compress attachments and only send attachments when they are productive. Moreover, you need to have a good virus scanner in place since your customers will not be very happy if you send them documents full of viruses!

8. Use proper structure & layout.
Since reading from a screen is more difficult than reading from paper, the structure and lay out is very important for e-mail messages. Use short paragraphs and blank lines between each paragraph. When making points, number them or mark each point as separate to keep the overview.

9. Do not overuse the high priority option.
We all know the story of the boy who cried wolf. If you overuse the high priority option, it will lose its function when you really need it. Moreover, even if a mail has high priority, your message will come across as slightly aggressive if you flag it as 'high priority'.

10. Do not write in CAPITALS.
IF YOU WRITE IN CAPITALS IT SEEMS AS IF YOU ARE SHOUTING. This can be highly annoying and might trigger an unwanted response in the form of a flame mail. Therefore, try not to send any email text in capitals.

11. Don't leave out the message thread.
When you reply to an email, you must include the original mail in your reply, in other words click 'Reply', instead of 'New Mail'. Some people say that you must remove the previous message since this has already been sent and is therefore unnecessary. However, I could not agree less. If you receive many emails you obviously cannot remember each individual email. This means that a 'threadless email' will not provide enough information and you will have to spend a frustratingly long time to find out the context of the email in order to deal with it. Leaving the thread might take a fraction longer in download time, but it will save the recipient much more time and frustration in looking for the related emails in their inbox!

12. Add disclaimers to your emails.
It is important to add disclaimers to your internal and external mails, since this can help protect your company from liability. Consider the following scenario: an employee accidentally forwards a virus to a customer by email. The customer decides to sue your company for damages. If you add a disclaimer at the bottom of every external mail, saying that the recipient must check each email for viruses and that it cannot be held liable for any transmitted viruses, this will surely be of help to you in court (read more about email disclaimers). Another example: an employee sues the company for allowing a racist email to circulate the office. If your company has an email policy in place and adds an email disclaimer to every mail that states that employees are expressly required not to make defamatory statements, you have a good case of proving that the company did everything it could to prevent offensive emails.

13. Read the email before you send it.
A lot of people don't bother to read an email before they send it out, as can be seen from the many spelling and grammar mistakes contained in emails. Apart from this, reading your email through the eyes of the recipient will help you send a more effective message and avoid misunderstandings and inappropriate comments.

14. Do not overuse Reply to All.
Only use Reply to All if you really need your message to be seen by each person who received the original message.

15. Mailings > use the Bcc: field or do a mail merge.
When sending an email mailing, some people place all the email addresses in the To: field. There are two drawbacks to this practice: (1) the recipient knows that you have sent the same message to a large number of recipients, and (2) you are publicizing someone else's email address without their permission. One way to get round this is to place all addresses in the Bcc: field. However, the recipient will only see the address from the To: field in their email, so if this was empty, the To: field will be blank and this might look like spamming. You could include the mailing list email address in the To: field, or even better, if you have Microsoft Outlook and Word you can do a mail merge and create one message for each recipient. A mail merge also allows you to use fields in the message so that you can for instance address each recipient personally. For more information on how to do a Word mail merge, consult the Help in Word.

16. Take care with abbreviations and emoticons.
In business emails, try not to use abbreviations such as BTW (by the way) and LOL (laugh out loud). The recipient might not be aware of the meanings of the abbreviations and in business emails these are generally not appropriate. The same goes for emoticons, such as the smiley :-). If you are not sure whether your recipient knows what it means, it is better not to use it.

17. Be careful with formatting.
Remember that when you use formatting in your emails, the sender might not be able to view formatting, or might see different fonts than you had intended. When using colors, use a color that is easy to read on the background.

18. Take care with rich text and HTML messages.
Be aware that when you send an email in rich text or HTML format, the sender might only be able to receive plain text emails. If this is the case, the recipient will receive your message as a .txt attachment. Most email clients however, including Microsoft Outlook, are able to receive HTML and rich text messages.

19. Do not forward chain letters.
Do not forward chain letters. We can safely say that all of them are hoaxes. Just delete the letters as soon as you receive them.

20. Do not request delivery and read receipts.
This will almost always annoy your recipient before he or she has even read your message. Besides, it usually does not work anyway since the recipient could have blocked that function, or his/her software might not support it, so what is the use of using it? If you want to know whether an email was received it is better to ask the recipient to let you know if it was received.

21. Do not ask to recall a message.
Biggest chances are that your message has already been delivered and read. A recall request would look very silly in that case wouldn't it? It is better just to send an email to say that you have made a mistake. This will look much more honest than trying to recall a message.

22. Do not copy a message or attachment without permission.
Do not copy a message or attachment belonging to another user without permission of the originator. If you do not ask permission first, you might be infringing on copyright laws.

23. Do not use email to discuss confidential information.
Sending an email is like sending a postcard. If you don't want your email to be displayed on a bulletin board, don't send it. Moreover, never make any libelous, sexist or racially discriminating comments in emails, even if they are meant to be a joke.

24. Use a meaningful subject.
Try to use a subject that is meaningful to the recipient as well as yourself. For instance, when you send an email to a company requesting information about a product, it is better to mention the actual name of the product, e.g. 'Product A information' than to just say 'product information' or the company's name in the subject.

25. Use active instead of passive.
Try to use the active voice of a verb wherever possible. For instance, 'We will process your order today', sounds better than 'Your order will be processed today'. The first sounds more personal, whereas the latter, especially when used frequently, sounds unnecessarily formal.

26. Avoid using URGENT and IMPORTANT.
Even more so than the high-priority option, you must at all times try to avoid these types of words in an email or subject line. Only use this if it is a really, really urgent or important message.

27. Avoid long sentences.
Try to keep your sentences to a maximum of 15-20 words. Email is meant to be a quick medium and requires a different kind of writing than letters. Also take care not to send emails that are too long. If a person receives an email that looks like a dissertation, chances are that they will not even attempt to read it!

28. Don't send or forward emails containing libelous, defamatory, offensive, racist or obscene remarks.
By sending or even just forwarding one libelous, or offensive remark in an email, you and your company can face court cases resulting in multi-million dollar penalties.

29. Don't forward virus hoaxes and chain letters.
If you receive an email message warning you of a new unstoppable virus that will immediately delete everything from your computer, this is most probably a hoax. By forwarding hoaxes you use valuable bandwidth and sometimes virus hoaxes contain viruses themselves, by attaching a so-called file that will stop the dangerous virus. The same goes for chain letters that promise incredible riches or ask your help for a charitable cause. Even if the content seems to be bona fide, the senders are usually not. Since it is impossible to find out whether a chain letter is real or not, the best place for it is the recycle bin.

30. Keep your language gender neutral.
In this day and age, avoid using sexist language such as: 'The user should add a signature by configuring his email program'. Apart from using he/she, you can also use the neutral gender: ''The user should add a signature by configuring the email program'.

31. Don't reply to spam.
By replying to spam or by unsubscribing, you are confirming that your email address is 'live'. Confirming this will only generate even more spam. Therefore, just hit the delete button or use email software to remove spam automatically.

32. Use cc: field sparingly.
Try not to use the cc: field unless the recipient in the cc: field knows why they are receiving a copy of the message. Using the cc: field can be confusing since the recipients might not know who is supposed to act on the message. Also, when responding to a cc: message, should you include the other recipient in the cc: field as well? This will depend on the situation. In general, do not include the person in the cc: field unless you have a particular reason for wanting this person to see your response. Again, make sure that this person will know why they are receiving a copy.

Friday, August 22, 2014

Apache Kafka 0.8 on Windows

Apache Kafka is a scalable, distributed messaging system, which is increasingly getting popular and used by such renowned companies like LinkedIn, Tumblr, Foursquare, Spotify and Netflix [1].
Setting up a Kafka development environment on a Windows machine requires some configuration, so I created this little step-by-step installation tutorial for all the people who want to save themselves from some hours work ;-)
Setting up the Shell
To run Kafka you need a Linux shell under Windows. How do you do this? With the pretty awesome Cygwin tool.  So I’d like to go through the Cygwin installation, for all of you who have never used this tool beforehand.
You can download Cygwin from here. Most modern PCs have a modern 64-bit processor, so if you are one of these lucky guys, download the 64 bit version, otherwise, go for the 32 bit version.
Start the setup-x86_64.exe (respectively the setup-x86.exe) and click on ‘Next’. As the download source choose ‘Install from Internet’ and click ‘Next’.
Cygwin download source
Choose the installation directory and the user you want to install it for. If you don’t know what to do, my recommendation is to leave the default directory as it is and just install it for yourself.
Cygwin installation directory
Select a temporary package where you whant the downloaded temporary files to be stored, e.g. “C:\Users\Jan\Downloads” if your name is also Jan.
Cygwin temporary download folder
Select your internet connection. If you are at home you’ll most probably choose ‘Direct connection’. If you are within a university or company network you might need to add  a proxy configuration in order to make the download work (although I guess choosing ‘Use Internet Explorer Settings’ should be sufficient). Cygwin connection
You then need to choose a site where the packages should be downloaded from. I usually pick a university server which is close to my home location.
Cygwin download site
Now you will get to a packages selection page where you can select all the useful linux tools and commands that you’d like to have installed. For our use case it is sufficient to leave the default configuration. However, if you are faced with some command not found errors lateron, you might reinstall Cygwin with the necessary packages.
Cygwin select packages
After Cygwin has finished downloading the packages, select ‘Create icon on Desktop’ and finish the installation.
Cygwin finish installation
Now lets test the Cygwin shell. Click on your Cygwin desktop icon. The shell should open with your home directoy as seen in the screen.
Cygwin shell
Now you got a full linux shell and do all the funny commands, such like ‘ls’ (the linux ‘dir’ equivalent). Go to the root folder by typing ‘cd /’. Now enter ‘ls’ to show a list of the files & dirs at the root level.
Cygwin root dir
But you are not interested in the Cygwin root directory, but rather want to dive in to your Windows harddisk. The Windows drives are mounted under ‘cygdrive’. So change directory by entering ‘cd cygdrive’ and list the content with ‘ls’. You should now see all your drives. In my case I am on my laptop and have only the c drive. Change to the c drive and list the contents.Cygwin windows c
To avoid having to type all this, you can automatically switch to another directory when the shell starts. Go to your Cygwin installation directory and enter the etc directory (in my case: C:\cygwin64\etc)  and open the file bash.bashrc with your favourite text editor. Go to the bottom of the file, add the line ‘cd /cygdrive/c/’ and save.Cygwin bash.bashrc
Now open another shell by clicking on the Cygwin icon on your desktop. It should open with the c drive. Cygwin c drive
Ok, now that you have Cygwin up and running, let’s unravel the mysteries of Kafka.
Setting up Kafka
Download the latest 0.8 version of the Kafka binary from the Kafka download page. Note. that although the latest release marked as stable is the 0.7.2 release, the kafka guys have already switched the documentation to 0.8 and say that the 0.8 beta is already used in production. Now, extract the .tgz file. Now go to the extracted folder and extract the .tar file.
Extracted kafka folder
Now, copy the kafka folder and drop it to the c drive (in my case C:\kafka_2.8.0-0.8.0-beta1). I recommend you not to copy it to the ‘Program Files’ folder, since the space can cause problems with the shell scripts.
Now the next step according to the kafka documentation would be to execute ‘./sbt update’. So let’s do that. Open the shell, switch to the kafka folder and execute the command.
Kafka sbt update
Oh no, we get an error ‘-bash: ./sbt: No such file or directory’. We are missing the sbt command! So for those of you who didn’t know sbt before (like myself), a quick google search reveals that it’s the scala build tool we are missing. Download the sbt windows installer from the sbt download page. Download the .msi installer for windows. Install sbt following the wizard (you can use the standard configuration).
Since sbt writes itself to the environment variables, you will have to restart your shell in order for it to find sbt. So close the shell, open it again and go to the kafka folder. Execute ‘sbt update’. Sbt will start doing its update work.
Kafka sbt update 2
After some time, the sbt should stop with the line
[success] Total time: 2 s, completed 13-Oct-2013 11:21:32
Now, execute the second step from the kafka documentation, enter ‘sbt package’. Again it should finish without errors. Finally, type ‘sbt assembly-package-dependency’.
Doh! We get an error:
[error] Not a valid command: assembly-package-dependency
[error] Not a valid project ID: assembly-package-dependency
[error] Expected ‘:’ (if selecting a configuration)
[error] Not a valid key: assembly-package-dependency (similar: sbt-dependency)
[error] assembly-package-dependency
[error] ^
Kafka sbt dependency error
Now thats not good, we get a cryptic error message. Luckily, someone in the wiki alrea already found a solution, type ‘sbt sbt-dependency’.
Kafka sbt dependency
Ok, so we should be ready to go! The first thing we have to do is to start the zookeeper server, which takes up the coordination among your kafka nodes. Start it with ‘bin/zookeeper-server-start.sh config/zookeeper.properties’.
And again, we get an error
bin/kafka-run-class.sh: line 67: “C:/Program: No such file or directory
Again, the great & active kafka community has a solution for us. Go to the bin folder and edit the file ‘kafka-run-class.sh’. In line 67 you will find the following:
$JAVA $KAFKA_OPTS $KAFKA_JMX_OPTS -cp $CLASSPATH “$@”
Now change that to
$JAVA $KAFKA_OPTS $KAFKA_JMX_OPTS -cp `cygpath -wp $CLASSPATH` “$@”
(replace $CLASSPATH with `cygpath -wp $CLASSPATH` including the backticks).
Now just before this line add the follow line
JAVA=”java”
Now you must make sure that java is set in the PATH variable of your system environment variables. Go to the windows control panel and search for environment.
Windows environment variables
In the System Properties dialog open the Advanced tab and click on environment variables. If you have a PATH variable set, click on edit, otherwise create it. Add the path to your java bin directory. In my case C:\Program Files\Java\jdk1.7.0_21\bin (note, if you have some entry in the PATH variable, you need to separate them with a semicolon). Windows path variable
This will prevent you from errors if you have your java installed in the program files directory like i do.
Now go to the kafka config directory and edit the ‘server.properties’ file. Change line 51 from
log.dir=/tmp/kafka-logs
to include double backslashes and pointing to a directory on your harddisk. E.g.
log.dir=c:\\kafka_2.8.0-0.8.0-beta1\\kafka-logs
If your c drive is a ssd, i recommend you to store the logs on your hdd since the logs can grow quite big. Remember to not use any spaces in the path to avoid problems and to use the double backslashes! E.g. d:\\data\\kafka-logs
Do the same for line 113, in my case I changed it to
kafka.csv.metrics.dir=c:\\kafka_2.8.0-0.8.0-beta1\\kafka-metrics
Save the file, edit the log4j.properties file. Change line 23 from
log4j.appender.kafkaAppender.File=server.log
to
log4j.appender.kafkaAppender.File=c:\\kafka_2.8.0-0.8.0-beta1\\logs\\server.log
Do the same for line 29 and 35.
Finally, do the same for the zookeeper.properties file. Change line 16 from
dataDir=/tmp/zookeeper
to
dataDir=c:\\kafka_2.8.0-0.8.0-beta1\\dataDir
Now start again the zookeeper by entering 
bin/zookeeper-server-start.sh config/zookeeper.properties
Zookeeper should start successfully and the Windows firewall will ask you whether you want to grant it access. Confirm this by clicking on Allow.
Ok, zookeeper is up and running, now let’s start kafka. Open a second shell, go to the kafka folder and enter
bin/kafka-server-start.sh config/server.properties
Kafka up and running as well, so lets try it out! Open two more shells and switch to the kafka folder in both shells.
In the first shell:
Create a topic with the following line
bin/kafka-create-topic.sh –zookeeper localhost:2181 –replica 1 –partition 1 –topic test
This will create the topic ‘test’ . In the same shell,  enter
bin/kafka-list-topic.sh –zookeeper localhost:2181
Somewhere in the log output, there should appear the following line, indicating that you successfully created the test topic:
topic: test partition: 0 leader: 0 replicas: 0 isr: 0
Now we are going to push some messages to the queue. Start the basic producer by entering
bin/kafka-console-producer.sh –broker-list localhost:9092 –topic test
Some log information will be printed and the program does not return the control. So you can now freely enter messages (like ‘Hello world!’).
Kafka hello world
Go to the second shell and start the consumer by entering
bin/kafka-console-consumer.sh –zookeeper localhost:2181 –topic test –from-beginning
The consumer will open and at the end of some log messages, it will display the message we just entered in the producer.
Kafka hello world consumer
Thats it, you are now ready to start developing for Kafka on Windows! If you like this article, please share it, thanks!

Thursday, August 21, 2014


Current Date and Time :
Current Time in Milliseconds :

Wednesday, August 20, 2014

Tar / untar Command Examples in Linux 18 different type of commands

The Linux “tar” stands for tape archive, which is used by large number of Linux/Unix system administrators to deal with tape drives backup. The tar command used to rip a collection of files and directories into highly compressed archive file commonly called tarball or targzipand bzip in Linux. The tar is most widely used command to create compressed archive files and that can be moved easily from one disk to anther disk or machine to machine.


n this article we will going to review and discuss various tar command examples including how to create archive files using (tartar.gz and tar.bz2) compression, how to extract archive file, extract a single file, view content of file, verify a file, add files or directories to archive file, estimate the size of tar archive file, etc.
The main purpose of this guide is to provide various tar command examples that might be helpful you to understand and become expert in tar archive manipulation

1. Create tar Archive File

The below example command will create a tar archive file tecmint-14-09-12.tar for a directory /home/tecmint in current working directory. See the example command in action.
# tar -cvf tecmint-14-09-12.tar /home/tecmint/

/home/tecmint/
/home/tecmint/cleanfiles.sh
/home/tecmint/openvpn-2.1.4.tar.gz
/home/tecmint/tecmint-14-09-12.tar
/home/tecmint/phpmyadmin-2.11.11.3-1.el5.rf.noarch.rpm
/home/tecmint/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
Let’s discuss the each option we have used in the above command for creating tar archive file.
  1. c – Creates a new .tar archive file.
  2. v – Verbosely show the .tar file progress.
  3. f – File name type of the archive file.

2. Create tar.gz Archive File

To create a compressed gzip archive file we use the option as z. For example the below command will create a compressed MyImages-14-09-12.tar.gz file for the directory/home/MyImages. (Note : tar.gz and tgz both are similar).
# tar cvzf MyImages-14-09-12.tar.gz /home/MyImages
OR
# tar cvzf MyImages-14-09-12.tgz /home/MyImages

/home/MyImages/
/home/MyImages/Sara-Khan-and-model-Priyanka-Shah.jpg
/home/MyImages/RobertKristenviolent101201.jpg
/home/MyImages/Justintimerlakenaked101125.jpg
/home/MyImages/Mileynudephoto101203.jpg
/home/MyImages/JenniferRobert101130.jpg
/home/MyImages/katrinabarbiedoll231110.jpg
/home/MyImages/the-japanese-wife-press-conference.jpg
/home/MyImages/ReesewitherspoonCIA101202.jpg
/home/MyImages/yanaguptabaresf231110.jpg

3. Create tar.bz2 Archive File

The bz2 feature compress and create archive file less than the size of the gzip. The bz2compression takes more time to compress and decompress files as compared to gzip which takes less time. To create highly compressed tar file we use option as j. The following example of command will create a Phpfiles-org.tar.bz2 file for a directory /home/php. (Note: tar.bz2 and tbz is similar as tb2).
# tar cvfj Phpfiles-org.tar.bz2 /home/php
OR
# tar cvfj Phpfiles-org.tar.tbz /home/php
OR 
# tar cvfj Phpfiles-org.tar.tb2 /home/php

/home/php/
/home/php/iframe_ew.php
/home/php/videos_all.php
/home/php/rss.php
/home/php/index.php
/home/php/vendor.php
/home/php/video_title.php
/home/php/report.php
/home/php/object.html
/home/php/video.php

4. Untar tar Archive File

To untar or extract a tar file, just issue following command using option x (extract). For example the below command will untar the file public_html-14-09-12.tar in present working directory. If you want untar in a different directory then use option as -C (specified directory).
## Untar files in Current Directory ##
# tar -xvf public_html-14-09-12.tar

## Untar files in specified Directory ##
# tar -xvf public_html-14-09-12.tar -C /home/public_html/videos/

/home/public_html/videos/
/home/public_html/videos/views.php
/home/public_html/videos/index.php
/home/public_html/videos/logout.php
/home/public_html/videos/all_categories.php
/home/public_html/videos/feeds.xml

5. Uncompress tar.gz Archive File

To Uncompress tar.gz archive file, just run following command. If would like to untar in different directory just use option -C and the path of the directory,  like we shown in the above example.
# tar -xvf thumbnails-14-09-12.tar.gz

/home/public_html/videos/thumbnails/
/home/public_html/videos/thumbnails/katdeepika231110.jpg
/home/public_html/videos/thumbnails/katrinabarbiedoll231110.jpg
/home/public_html/videos/thumbnails/onceuponatime101125.jpg
/home/public_html/videos/thumbnails/playbutton.png
/home/public_html/videos/thumbnails/ReesewitherspoonCIA101202.jpg
/home/public_html/videos/thumbnails/snagItNarration.jpg
/home/public_html/videos/thumbnails/Minissha-Lamba.jpg
/home/public_html/videos/thumbnails/Lindsaydance101201.jpg
/home/public_html/videos/thumbnails/Mileynudephoto101203.jpg

6. Uncompress tar.bz2 Archive File

To Uncompress highly compressed tar.bz2 file, just use the following command. The below example command will untar all the .flv files from the archive file.
# tar -xvf videos-14-09-12.tar.bz2

/home/public_html/videos/flv/katrinabarbiedoll231110.flv
/home/public_html/videos/flv/BrookmuellerCIA101125.flv
/home/public_html/videos/flv/dollybackinbb4101125.flv
/home/public_html/videos/flv/JenniferRobert101130.flv
/home/public_html/videos/flv/JustinAwardmovie101125.flv
/home/public_html/videos/flv/Lakme-Fashion-Week.flv
/home/public_html/videos/flv/Mileynudephoto101203.flv
/home/public_html/videos/flv/Minissha-Lamba.flv

7. List Content of tar Archive File

To list the content of tar archive file, just run the following command with option t (list content). The below command will list the content of uploadprogress.tar file.
# tar -tvf uploadprogress.tar

-rw-r--r-- chregu/staff   2276 2011-08-15 18:51:10 package2.xml
-rw-r--r-- chregu/staff   7877 2011-08-15 18:51:10 uploadprogress/examples/index.php
-rw-r--r-- chregu/staff   1685 2011-08-15 18:51:10 uploadprogress/examples/server.php
-rw-r--r-- chregu/staff   1697 2011-08-15 18:51:10 uploadprogress/examples/info.php
-rw-r--r-- chregu/staff    367 2011-08-15 18:51:10 uploadprogress/config.m4
-rw-r--r-- chregu/staff    303 2011-08-15 18:51:10 uploadprogress/config.w32
-rw-r--r-- chregu/staff   3563 2011-08-15 18:51:10 uploadprogress/php_uploadprogress.h
-rw-r--r-- chregu/staff  15433 2011-08-15 18:51:10 uploadprogress/uploadprogress.c
-rw-r--r-- chregu/staff   1433 2011-08-15 18:51:10 package.xml

8. List Content tar.gz Archive File

Use the following command to list the content of tar.gz file.
# tar -tvf staging.tecmint.com.tar.gz

-rw-r--r-- root/root         0 2012-08-30 04:03:57 staging.tecmint.com-access_log
-rw-r--r-- root/root       587 2012-08-29 18:35:12 staging.tecmint.com-access_log.1
-rw-r--r-- root/root       156 2012-01-21 07:17:56 staging.tecmint.com-access_log.2
-rw-r--r-- root/root       156 2011-12-21 11:30:56 staging.tecmint.com-access_log.3
-rw-r--r-- root/root       156 2011-11-20 17:28:24 staging.tecmint.com-access_log.4
-rw-r--r-- root/root         0 2012-08-30 04:03:57 staging.tecmint.com-error_log
-rw-r--r-- root/root      3981 2012-08-29 18:35:12 staging.tecmint.com-error_log.1
-rw-r--r-- root/root       211 2012-01-21 07:17:56 staging.tecmint.com-error_log.2
-rw-r--r-- root/root       211 2011-12-21 11:30:56 staging.tecmint.com-error_log.3
-rw-r--r-- root/root       211 2011-11-20 17:28:24 staging.tecmint.com-error_log.4

9. List Content tar.bz2 Archive File

To list the content of tar.bz2 file, issue the following command.
# tar -tvf Phpfiles-org.tar.bz2

drwxr-xr-x root/root         0 2012-09-15 03:06:08 /home/php/
-rw-r--r-- root/root      1751 2012-09-15 03:06:08 /home/php/iframe_ew.php
-rw-r--r-- root/root     11220 2012-09-15 03:06:08 /home/php/videos_all.php
-rw-r--r-- root/root      2152 2012-09-15 03:06:08 /home/php/rss.php
-rw-r--r-- root/root      3021 2012-09-15 03:06:08 /home/php/index.php
-rw-r--r-- root/root      2554 2012-09-15 03:06:08 /home/php/vendor.php
-rw-r--r-- root/root       406 2012-09-15 03:06:08 /home/php/video_title.php
-rw-r--r-- root/root      4116 2012-09-15 03:06:08 /home/php/report.php
-rw-r--r-- root/root      1273 2012-09-15 03:06:08 /home/php/object.html

10. Untar Single file from tar File

To extract a single file called cleanfiles.sh from cleanfiles.sh.tar use the following command.
# tar -xvf cleanfiles.sh.tar cleanfiles.sh
OR
# tar --extract --file=cleanfiles.sh.tar cleanfiles.sh

cleanfiles.sh

11. Untar Single file from tar.gz File

To extract a single file tecmintbackup.xml from tecmintbackup.tar.gz archive file, use the command as follows.
# tar -zxvf tecmintbackup.tar.gz tecmintbackup.xml
OR
# tar --extract --file=tecmintbackup.tar.gz tecmintbackup.xml

tecmintbackup.xml

12. Untar Single file from tar.bz2 File

To extract a single file called index.php from the file Phpfiles-org.tar.bz2 use the following option.
# tar -jxvf Phpfiles-org.tar.bz2 home/php/index.php
OR
# tar --extract --file=Phpfiles-org.tar.bz2 /home/php/index.php

/home/php/index.php

13. Untar Multiple files from tar, tar.gz and tar.bz2 File

To extract or untar multiple files from the tartar.gz and tar.bz2 archive file. For example the below command will extract “file 1” “file 2” from the archive files.
# tar -xvf tecmint-14-09-12.tar "file 1" "file 2" 

# tar -zxvf MyImages-14-09-12.tar.gz "file 1" "file 2" 

# tar -jxvf Phpfiles-org.tar.bz2 "file 1" "file 2"

14. Extract Group of Files using Wildcard

To extract a group of files we use wildcard based extracting. For example, to extract a group of all files whose pattern begins with .php from a tar, tar.gz and tar.bz2 archive file.
# tar -xvf Phpfiles-org.tar --wildcards '*.php'

# tar -zxvf Phpfiles-org.tar.gz --wildcards '*.php'

# tar -jxvf Phpfiles-org.tar.bz2 --wildcards '*.php'

/home/php/iframe_ew.php
/home/php/videos_all.php
/home/php/rss.php
/home/php/index.php
/home/php/vendor.php
/home/php/video_title.php
/home/php/report.php
/home/php/video.php

15. Add Files or Directories to tar Archive File

To add files or directories to existing tar archived file we use the option r (append). For example we add file xyz.txt and directory php to existing tecmint-14-09-12.tar archive file.
# tar -rvf tecmint-14-09-12.tar xyz.txt

# tar -rvf tecmint-14-09-12.tar php

drwxr-xr-x root/root         0 2012-09-15 02:24:21 home/tecmint/
-rw-r--r-- root/root  15740615 2012-09-15 02:23:42 home/tecmint/cleanfiles.sh
-rw-r--r-- root/root    863726 2012-09-15 02:23:41 home/tecmint/openvpn-2.1.4.tar.gz
-rw-r--r-- root/root  21063680 2012-09-15 02:24:21 home/tecmint/tecmint-14-09-12.tar
-rw-r--r-- root/root   4437600 2012-09-15 02:23:41 home/tecmint/phpmyadmin-2.11.11.3-1.el5.rf.noarch.rpm
-rw-r--r-- root/root     12680 2012-09-15 02:23:41 home/tecmint/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
-rw-r--r-- root/root 0 2012-08-18 19:11:04 xyz.txt
drwxr-xr-x root/root 0 2012-09-15 03:06:08 php/ 
-rw-r--r-- root/root 1751 2012-09-15 03:06:08 php/iframe_ew.php 
-rw-r--r-- root/root 11220 2012-09-15 03:06:08 php/videos_all.php 
-rw-r--r-- root/root 2152 2012-09-15 03:06:08 php/rss.php 
-rw-r--r-- root/root 3021 2012-09-15 03:06:08 php/index.php 
-rw-r--r-- root/root 2554 2012-09-15 03:06:08 php/vendor.php 
-rw-r--r-- root/root 406 2012-09-15 03:06:08 php/video_title.php

16. Add Files or Directories to tar.gz and tar.bz2 files

The tar command don’t have a option to add files or directories to a existing compressedtar.gz and tar.bz2 archive file. If we do try will get tbe following error.
# tar -rvf MyImages-14-09-12.tar.gz xyz.txt

# tar -rvf Phpfiles-org.tar.bz2 xyz.txt

tar: This does not look like a tar archive
tar: Skipping to next header
xyz.txt
tar: Error exit delayed from previous errors

17. How To Verify tar, tar.gz and tar.bz2 Archive File

To verfify any tar or compressed archived file we use option as W (verify). To do, just use the following examples of command. (Note : You cannot do verification on a compressed (*.tar.gz, *.tar.bz2 ) archive file).
# tar tvfW tecmint-14-09-12.tar

tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers
tar: VERIFY FAILURE: 30740 invalid headers detected
Verify -rw-r--r-- root/root    863726 2012-09-15 02:23:41 /home/tecmint/openvpn-2.1.4.tar.gz
Verify -rw-r--r-- root/root  21063680 2012-09-15 02:24:21 /home/tecmint/tecmint-14-09-12.tar
tar: /home/tecmint/tecmint-14-09-12.tar: Warning: Cannot stat: No such file or directory
Verify -rw-r--r-- root/root   4437600 2012-09-15 02:23:41 home/tecmint/phpmyadmin-2.11.11.3-1.el5.rf.noarch.rpm
tar: /home/tecmint/phpmyadmin-2.11.11.3-1.el5.rf.noarch.rpm: Warning: Cannot stat: No such file or directory
Verify -rw-r--r-- root/root     12680 2012-09-15 02:23:41 home/tecmint/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
tar: /home/tecmint/rpmforge-release-0.5.2-2.el5.rf.i386.rpm: Warning: Cannot stat: No such file or directory
Verify -rw-r--r-- root/root         0 2012-08-18 19:11:04 xyz.txt
Verify drwxr-xr-x root/root         0 2012-09-15 03:06:08 php/

18. Check the Size of the tar, tar.gz and tar.bz2 Archive File

To check the size of any tartar.gz and tar.bz2 archive file, use the following command. For example the below command will display the size of archvie file in Kilobytes (KB).
# tar -czf - tecmint-14-09-12.tar | wc -c
12820480

# tar -czf - MyImages-14-09-12.tar.gz | wc -c
112640

# tar -czf - Phpfiles-org.tar.bz2 | wc -c
20480

Tar Usage and Options

  1. c – create a archive file.
  2. x – extract a archive file.
  3. v – show the progress of archive file.
  4. f – filename of archive file.
  5. t – viewing content of archive file.
  6. j – filter archive through bzip2.
  7. z – filter archive through gzip.
  8. r – append or update files or directories to existing archive file.
  9. W – Verify a archive file.
  10. wildcards – Specify patters in unix tar command.
That’s it for now, hope the above tar command examples are enough for you to learn and for more information please use man tar command. If we’ve missed any example please do share with us via comment box and please don’t forget to share this article with your friends. This is the best way to say thanks…..