-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases
78 lines (65 loc) · 2.52 KB
/
.aliases
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#############
### Linux ###
#############
if [[ "$OSTYPE" = linux* ]]; then
# GNU utils
alias ls="ls --almost-all --classify --color=auto --group-directories-first --literal --sort=extension"
alias l="ls --almost-all --classify --color=auto --group-directories-first --human-readable -l --literal --sort=extension"
alias cp="cp --interactive --verbose"
alias mv="mv --interactive --verbose"
alias rm="rm --interactive=once --verbose"
alias fstabshow="column -t /etc/fstab"
fi
#############
### macOS ###
#############
if [[ "$OSTYPE" = darwin* ]]; then
# BSD utils
alias ls="ls -AFG"
alias l="ls -AFGlhS"
alias cp="cp -iv"
alias mv="mv -iv"
alias rm="rm -Rv"
fi
###############
### commons ###
###############
# utils (blank space so its not in history)
alias clear=" clear"
alias claer=" clear"
alias exit=" exit"
alias fd="fd --hidden"
alias edit="emacs -Q -nw"
alias screenoff="setterm -blank 1"
alias logo="sudo pkill -u $USER"
alias curldl="curl --location --progress-bar --remote-name"
alias youtube2mp3="youtube-dl --audio-format mp3 --audio-quality 0 --extract-audio"
alias chatty="nohup java -jar /opt/Chatty/Chatty.jar </dev/null &>/dev/null & disown;"
alias cdtbb="cd ~/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/Browser/Downloads/"
alias wgetws="wget -mpEk" # add "--wait=seconds" if ban occurs
# security/privacy
alias chckvir="sudo freshclam && clamscan --recursive=yes --infected /"
alias metaimgremove="exiftool -overwrite_original -all="
#################
### functions ###
#################
metavideoremove () { ffmpeg -i "$1" -vcodec copy -acodec copy -map 0 -map_metadata -1 cleaned-"$1"; }
hex10 () { hexdump -v -n 5 -e '4/4 "%x" 1 "\n"' /dev/urandom; }
fnd () { find . -iname "*$1*" 2>/dev/null | grep --color=auto --ignore-case -e "$1"; }
# grep
lgrep () { find . -maxdepth 1 -type f -exec grep \
--binary-file=without-match \
--color=auto \
--ignore-case \
--line-number \
--null "$1" {} +; }
rgrep () { find . -type f -exec grep \
--binary-file=without-match \
--color=auto \
--ignore-case \
--line-number \
--null "$1" {} +; }
rgrep2 () { grep --binary-file=without-match --color=auto --ignore-case --line-number --no-messages --null --recursive "$1" .; }
# ripgrep
lrg () { rg --follow --hidden --max-depth 1 --search-zip --smart-case -e "$1" .; }
rrg () { rg --follow --hidden --search-zip --smart-case "$1" .; }