Skip to content

Instantly share code, notes, and snippets.

@naranyala
Last active August 8, 2023 03:11
Show Gist options
  • Save naranyala/20042e800be67ab92084dbd2273e1546 to your computer and use it in GitHub Desktop.
Save naranyala/20042e800be67ab92084dbd2273e1546 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Check if the 7z file argument is provided
if [ -z "$1" ]; then
echo "Please provide the path to the 7z file as the first argument."
exit 1
fi
# Verify if the 7z file exists
archive="$1"
if [ ! -f "$archive" ]; then
echo "File not found!"
exit 1
fi
# Extract the file to the current directory
7z x "$archive" -o.
echo "Extraction complete!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment