Compression Commands

Duration: 10 min

This video lesson is available to enrolled students.

Enroll to watch — DSSSB TGT Computer Science 2026 Section B

AI summary & chapters

AI Summary

An AI-generated summary of this video lecture.

This lecture introduces Linux compression commands and additional useful terminal utilities. It begins by explaining tar and gzip, showing how to create archives with tar -cvf, extract them with tar -xvf or tar -xf, and compress files using gzip. The instructor annotates the meaning of flags such as c for create, v for verbose, and f for archive file. The lesson then covers gunzip, zip, and unzip for decompressing .gz files and managing ZIP archives. Finally, it transitions to additional useful commands including tee, wc, sort, cut, uniq, echo $?, lsusb, and tcpdump, with terminal examples demonstrating their outputs.

Chapters

  1. 0:00 2:00 00:00-02:00

    The opening slide titled 'Compression Commands' presents tar and gzip examples. The instructor highlights the -cvf flag in tar -cvf archive.tar /home/user/documents, explaining that c creates an archive, v enables verbose output, and f specifies the archive file. The extraction command tar -xf or tar -xvf archive.tar is shown with red annotations indicating how to unpack the archive. A note at the bottom explains combining tar and gzip using -czvf for compressed archives, as in tar -czvf archive.tar.gz /path/to/dir.

  2. 2:00 5:00 02:00-05:00

    The lecture continues with gzip file.txt, showing the resulting compressed output file.txt.gz and using ls -l to verify size reduction. The instructor underlines key terms in the purpose column for both tar and gzip, emphasizing that gzip compresses a single file into .gz format. The segment then transitions to a new table listing gunzip, zip, and unzip commands. gunzip is described as decompressing .gz files and restoring them to their original format, while zip creates a ZIP archive of files or directories and unzip extracts files from a ZIP archive.

  3. 5:00 9:46 05:00-09:46

    The lesson moves to a slide titled 'Additional Useful Commands,' presenting tee, wc, sort, and cut. tee reads from standard input and writes output to both a file and the screen; wc -l -w -c file.txt prints line, word, and byte counts; sort names.txt sorts lines alphabetically or numerically; and cut -d',' -f1,3 data.csv extracts specific fields from CSV data. The final table covers uniq -c for counting repeated lines, echo $? for displaying the exit status of the previous command, lsusb for listing USB devices, and tcpdump for network packet capture. Red annotations highlight flags and output values throughout.

The lecture progresses from basic compression to broader terminal utilities. Central concepts include tar's flag-based syntax, where c, v, and f control creation, verbosity, and file specification. The combination of tar with gzip via -czvf is a key practical skill for creating compressed archives. gunzip, zip, and unzip extend compression management to .gz and ZIP formats. The additional commands section shifts focus from file compression to text processing and system inspection: tee for dual output, wc for counting, sort for ordering, cut for field extraction, uniq -c for frequency counts, echo $? for exit codes, lsusb for hardware enumeration, and tcpdump for network analysis. The teaching method relies on structured tables pairing each command with its purpose and a terminal example, supplemented by red handwritten annotations that break down flags and outputs. This approach supports exam revision by linking command syntax to observable results.

Loading lesson…