This repository has been archived by the owner on Dec 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
alias
60 lines (56 loc) · 2.55 KB
/
alias
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
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 foldmethod=marker filetype=bash
# ----------------------------------------------------------------------------
# Author: Mubarak Alrashidi (DeaDSouL)
# Package: dsBash
# Info: Setting up your bash environment
# License: GNU/GPL v3
# URL: https://gitlab.com/DeaDSouL/dsBash
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# ds.alias_loaded: Show the loaded aliases OS type #{{{
ds.alias_loaded() {
[[ "$load_linux" = true ]] && echo -e " Linux : ${BGREEN}True${NC}" || echo -e " Linux : ${BRED}False${NC}"
[[ "$load_mac" = true ]] && echo -e " MacOS : ${BGREEN}True${NC}" || echo -e " MacOS : ${BRED}False${NC}"
[[ "$load_maclin" = true ]] && echo -e "MacLin : ${BGREEN}True${NC}" || echo -e "MacLin : ${BRED}False${NC}"
} #}}}
# ds.alias_all: Show all available aliases #{{{
ds.alias_all() {
echo -e "${BRED}Main Commands:"
echo -e " ${BBLUE}ds.alias_loaded${NC} ${FG}: Showing the loaded aliases."
echo -e " ${BBLUE}ds.alias_linux${NC} ${FG}: Listing the available Linux aliases."
echo -e " ${BBLUE}ds.alias_mac${NC} ${FG}: Listing the available MacOSX aliases."
echo -e " ${BBLUE}ds.alias_maclin${NC} ${FG}: Listing the available both aliases."
echo -e " ${BBLUE}ds.alias_search${NC} ${FG}: Search or show info about alias.${NC} ${YELLOW}(ex: ds.alias_search ds.findtext)${NC}"
echo ""
[[ "$load_linux" = true ]] && ds.alias_linux;
[[ "$load_mac" = true ]] && ds.alias_mac;
[[ "$load_maclin" = true ]] && ds.alias_maclin;
} #}}}
# ds.: Shortcut to ds.aliasl_all #{{{
ds.() {
ds.alias_all
} #}}}
# ds.alias_search: Search for alias #{{{
ds.alias_search() {
if [[ -z "$1" ]]; then
echo 'invalid input! Try: ds.alias_all'
else
ds.alias_all | grep -i "$1" || echo 'Nothing found'
fi
} #}}}
# ----------------------------------------------------------------------------
# Files & Folders
# Better ls #{{{
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
#}}}
# Auto flags
alias grep='grep --color=auto' # Adding colors
alias fgrep='fgrep --color=auto' # Adding colors
alias egrep='egrep --color=auto' # Adding colors
alias cp="cp -i" # confirm before overwriting something
alias df='df -h' # human-readable sizes
alias free='free -m' # show sizes in MB
alias more=less
# ----------------------------------------------------------------------------