Skip to content

Instantly share code, notes, and snippets.

@isaactzab
Last active October 1, 2019 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaactzab/4ce3ed992a639da62147b03098d0d657 to your computer and use it in GitHub Desktop.
Save isaactzab/4ce3ed992a639da62147b03098d0d657 to your computer and use it in GitHub Desktop.
Terminal Helpers
#!/bin/sh
# kill all proccess with name provided
if [ ! -z "${1}" ]
then
kill -9 $(ps aux | grep "${1}" | awk '{print $2}')
else
echo "Please provide an process name to kill all related process"
fi
exit
#/bin/bash
# argument with backup name or default backup name `{directory_name}_backup`
backup="${1:-${PWD##*/}_backup}"
# timestamp
timestamp=$(date +"%Y-%m-%d_%H-%M-%S")
# zip all listed files in git status
zip "${backup}_${timestamp}.zip" $(git status --porcelain | sed s/^...// | sed 's/\/$/\/*/')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment