-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalias.sh
executable file
·52 lines (40 loc) · 1.57 KB
/
alias.sh
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
#!/bin/sh
##########################################################################
# Filename: .../dotfiles/alias.sh #
# Purpose: File that defines the aliases for some commands #
# Authors: Giulio Coa <34110430+giulioc008@users.noreply.github.com> #
# License: This file is licensed under the LGPLv3. #
##########################################################################
alias cd..='cd ..'
alias hystory='history'
alias ls='ls --almost-all --human-readable --color=auto'
if command -v diff > /dev/null 2> /dev/null; then
alias diff='diff --color=auto'
fi
if command -v docker-compose > /dev/null 2> /dev/null; then
alias docker-compose='sudo docker-compose'
fi
if command -v docker > /dev/null 2> /dev/null; then
alias docker='sudo docker'
if ! command -v docker-compose > /dev/null 2> /dev/null; then
alias docker-compose='sudo docker compose'
fi
fi
if command -v grep > /dev/null 2> /dev/null; then
alias grep='grep --extended-regexp --no-messages --color=auto'
fi
if command -v ip > /dev/null 2> /dev/null; then
alias ip='ip --color=auto'
fi
if command -v sed > /dev/null 2> /dev/null; then
alias sed='sed --regexp-extended'
fi
if command -v shellcheck > /dev/null 2> /dev/null; then
alias shellcheck='shellcheck --check-sourced --color=auto --external-sources'
fi
if command -v shfmt > /dev/null 2> /dev/null; then
alias shfmt='shfmt --indent 2 --case-indent --binary-next-line --space-redirects'
fi
if command -v sudo > /dev/null 2> /dev/null; then
alias sudo='sudo '
fi