Last active
August 29, 2015 14:23
-
-
Save jmatsu/74fcfe62a0413cf021e8 to your computer and use it in GitHub Desktop.
便利系
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
# 解凍 | |
for tgz in `find . -maxdepth 1 -type f -iname \*.tgz`; do | |
tar -xvf $tgz | |
done | |
# ゴミ処理 | |
for garbage in `find -E . -type f -iregex '^(\._.*|.*\~|#.*|.*\.DS_Store)$'`; do | |
rm $garbage | |
done | |
# recursive removal can be realized by deleting "-maxdepth 1" | |
rm_zero_f() { | |
for _FILE in `find . -type f -maxdepth 1`; do [ ! -s $_FILE ] && rm $_FILE; done | |
} | |
# script location (consider symbolic) | |
_MY_LOCATION="$(\cd "$(dirname "${BASH_SOURCE:-${(%):-%N}}")"; _pwd=`pwd`/${_MY_NAME}; | |
\cd "$(dirname `readlink -f ${_pwd} 2> /dev/null||readlink ${_pwd}`)" ; pwd)" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment