-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bash_aliases
50 lines (36 loc) · 1.1 KB
/
.bash_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
# All kind of bash aliases
# Editing
alias e='vim -O'
alias d='vim -d'
alias s='git status'
# Navigation
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias ack='ack-grep'
# Finding files
alias fgr='find . | xargs grep -i -n -s \!*'
alias fgr_sym='find . | xargs grep -i -n -s \!*'
#Last changes
function find_last_changes() {
find "$1" -type f -print0 | xargs -0 stat --format '%Y :%y %n' | sort -nr | cut -d: -f2-
}
function find_my_files() {
find "$1" -user ${USER} -type f -print0 | xargs -0 stat --format '%n' | sort -nr | cut -d: -f2- | grep -v '\.cmake\.state' | grep -v '\..\+\.swp'
}
function inotify_pytest() {
while inotifywait -r --exclude='.*.swp' -e modify . ; do
pytest
# Wait a little bit before rescheduling
sleep 5
done
}
# Repeat a command: usage: repeat_me <iterations> <time_to_sleep> <command>
# example: >repeat_me 5 30s echo bla
#function repeat_me() {
# repeat "$1" echo `"$3*" && sleep "$2"`
#}
#
# Fun
alias is_het_al_vrijdag=date\ \+\%A\ \|\ awk\ \''{ print ($1 == "Friday") ? "Ja!" : "Nee, helaas" }'\'
alias weeknummer='date +%V'