-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions
41 lines (37 loc) · 1.24 KB
/
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
# 21/03/23
# CHEAT
cheat () {
curl "cheat.sh/$1"
}
# EXTRACT
# Extracts archived files
extract () {
if [ -f $1 ]; then
case $1 in
*.tar.bz2) tar -jxvf $1 ;;
*.tar.gz) tar -zxvf $1 ;;
*.bz2) bunzip2 $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar -xvf $1 ;;
*.tbz2) tar -jxvf $1 ;;
*.tgz) tar -zxvf $1 ;;
*.zip) unzip $1 ;;
*) echo "'$1' ne peut pas être extrait via extract()" ;;
esac
else
echo "'$1' n'est pas un fichier valide"
fi
}
# MKDIRCD
# Create a new directory and enter it
function mkdircd () {
mkdir "$@" && cd "$@"
}
# UPDATE
function update-terminal () {
curl -s https://jturazzi.github.io/dotfiles-linux/aliases > ~/.aliases
curl -s https://jturazzi.github.io/dotfiles-linux/functions > ~/.functions
curl -s https://jturazzi.github.io/dotfiles-linux/p10k.zsh > ~/.p10k.zsh
curl -s https://jturazzi.github.io/dotfiles-linux/zshrc > ~/.zshrc
source ~/.zshrc
}