How to tar and Untar files in unix
Quick Revision Summary
To Tar Files of a directory and sub directories recursively: tar cvzf foo.tgz freshershome Will tar the directory freshershome (and its files/subdirectories) into a tar file nam...
Interactive Practice Mode
Formulate your thoughts or take notes before revealing the model solution.
Saved automatically
Model Answer & Deep-Dive Explanation
To Tar Files of a directory and sub directories recursively:
tar cvzf foo.tgz freshershome
Will tar the directory freshershome (and its files/subdirectories) into a tar file named foo.tgz.
To extract gzip-1.2.4.tar and compile the sources on Unix systems, do:
tar xvf freshershome.tar
Or
tar -xzvf freshershome.tar.gz
Above will extract freshershome.tar.gz:
Will work on .tar.gz (or .tgz). Take out the 'z' for a plain .tar. Replace it with a 'j' for .tar.bz. Run 'man tar' for more complete instructions on using tar.
Interviewer Evaluation Points & Scoring Rubric
- 1 Structure answer clearly: Core concept, Practical example, and Pitfalls to avoid.
- 2 Demonstrate clear communication without unnecessary buzzwords.
- 3 Relate concept to real-world software development scenarios.
Related Questions in Unix / Linux
Unix/Linux administration interview questions
Advanced level • 828 views
Linux admin interview questions
Intermediate level • 745 views
Nix Application Programming
Intermediate level • 702 views
Unix/Linux programming interview questions
Intermediate level • 570 views
Php and MySQL Important Questions
Advanced level • 508 views