Skip to content

Instantly share code, notes, and snippets.

@hekt
Created February 6, 2012 23:51
Show Gist options
  • Save hekt/1755984 to your computer and use it in GitHub Desktop.
Save hekt/1755984 to your computer and use it in GitHub Desktop.
zip individual files/folders
#! /bin/bash
for f in "$@"
do
cd "${f%/*}"
zip -r "${f##*/}" "${f##*/}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment