forked from NMAAHC/zshrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc_functions
59 lines (50 loc) · 1.29 KB
/
zshrc_functions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# functions
# brew reinstall nmaahcmm
function nmaahcmm () {
brew reinstall nmaahcmm
}
# functions
# brew reinstall bashrc
function nmaahczshrc () {
brew reinstall zshrc
}
# make directories named after files
function makedirfile () {
for file in *.*; do
mkdir -p "${file%.*}";
done
}
# rsync transfer for DAMS uploads
function rsyncDAMS () {
rsync -avvPhi --no-p --stats "${@}"
}
# general rsync transfer
function rsyncT () {
rsync -avvPhi --stats "${@}"
}
# general rsync transfer with deletion of source files
function rsyncD () {
rsync -avvPhi --remove-source-files --stats "${@}"
}
# remove hidden files from a location
function removehidden () {
if [ -z "${1}" ] ; then
cowsay "no argument provided. tootles."
else
find "${1}" -name ".*" -exec rm -vfr {} \;
cowsay "hidden files removed. tootles."
fi
}
# sort text in a file by column 2 and overwrite file ; column separator is a space.
function sortk2 () {
if [ -z "${1}" ]; then
cowsay "no argument provided. tootles."
else
sort -k 2 -o "${1}" "${1}"
cowsay "file sorting is done. tootles."
fi
}
function shortinfo() {
mediainfo --Inform="General;FileName=%FileNameExtension%,FileSize=%FileSize%,Duration(ms),%Duration%\n" "${@}";
mediainfo --Inform="Video;Width=%Width%,Height=%Height%,Codec=%CodecID%\n" "${@}";
}