Last active
October 1, 2019 22:37
-
-
Save isaactzab/4ce3ed992a639da62147b03098d0d657 to your computer and use it in GitHub Desktop.
Terminal Helpers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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