Skip to content

Instantly share code, notes, and snippets.

View Issac-v's full-sized avatar
😇
Busy as fk

Coldle Issac-v

😇
Busy as fk
View GitHub Profile
#!/bin/bash
# function Extract for common file formats
function extract {
if [ -z "$1" ]; then
# display usage if no parameters given
echo "Usage: extract <path/file_name>.<zip|rar|bz2|gz|tar|tbz2|tgz|Z|7z|xz|ex|tar.bz2|tar.gz|tar.xz>"
else
if [ -f "$1" ] ; then
NAME=${1%.*}