Unix Mid Prep - Merged
Unix Mid Prep - Merged
> Some lines have been changed.: This line was modified in file2.txt compared to file1.txt.
4a5,6: This indicates that new lines have been added starting from line 5 in file2.txt.
> New lines have been added. and > New lines have been added at the end.: These lines are
the additions in file2.txt.
✓ The `zip` command is a commonly used utility for creating compressed archive files in
the ZIP format.
✓ It allows you to combine multiple files and directories into a single compressed
archive, making it easier to store and transfer large amounts of data.
Syntax:
zip [OPTIONS] ARCHIVE_NAME(.zip) FILE1 FILE2 ...
NOTE:
• Archiving refers to the process of collecting and storing data files or directories in a
compressed format or a single container file.
• The purpose of archiving is to reduce the size of the data and organize it for efficient
storage, backup, and transfer.
• When files or directories are archived, they are typically compressed to occupy less
disk space.
• Archiving software, such as ZIP, TAR, or RAR, is commonly used to create and
extract archives.
• Compressing refers to the process of reducing the size of files or directories by using
compression algorithms.
Dept. of CS
Handling Ordinary Files – File attributes
Examples:
1. Create a basic ZIP archive named sample.zip containing two files:
$ zip sample.zip.zip file1.txt file2.txt
2. Create a ZIP archive recursively including a directory and its contents:
$ zip -r sample.zip directory
3. Update an existing ZIP archive with new or modified files:
$ zip -u sample.zip newfile.txt
4. Delete files from an existing ZIP archive:
$ zip -d sample.zip file1.txt
Dept. of CS
Handling Ordinary Files – File attributes
Dept. of CS
Handling Ordinary Files – File attributes