-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalias
131 lines (131 loc) · 6.54 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# ALIASES
#
# more under https://www.gnu.org/software/bash/manual/html_node/Aliases.html
#----------------------------------------------------------------------------------------------------
# UMOUNT VS. UNMOUNT
# Deutsche Fehlermeldung, wenn umount nicht richtig verwendet wird.
#
if [ -f $HOME/.shellcfg/colors ]; then
alias unmount='echo -e "${RED}Syntaxfehler${NC}: der Befehl lautet ${GREEN}umount${NC} - ohne ${RED}n${NC} nach dem ersten ${RED}u${NC}."'
else
alias unmount='echo -e "Syntaxfehler: der Befehl lautet umount - ohne n nach dem ersten u."'
fi
#
# English error msg, when using umount incorrectly
# if [ -f $HOME/.shellcfg/colors ]; then
# alias unmount='echo -e "${RED}Syntax Error${NC}: Please use ${GREEN}umount${NC} - without ${RED}n${NC} after the first ${RED}u${NC}."'
# else
# alias unmount='echo -e "Syntax Error: Please use umount - without n after the first u"'
# fi
#
#----------------------------------------------------------------------------------------------------
# ls (suitable for Linux and OSX)
# souce: https://github.com/johnnygaffey/dotfiles/bash_alias
#
if [ -f /usr/bin/ls++ ]; then
alias ls='ls++ --potf -F' #colors
alias l='ls++ --potsf -F' #colors
alias ll='ls++ --potsf -ah' #long list
alias la='ls++ --potsf -A' #show hidden
alias lx='ls++ --potsf -B' #sort by sextension
alias lk='ls++ --potsf -Sr' #sort by size biggest last
alias lc='ls++ --potsf -tcr' #sort by and show chagne times
alias lu='ls++ --potsf -tur' #sort by and show access time
alias lt='ls++ --potsf -tr' #sort by date
alias lm='ls++ --potsf -a |more' #pipe through more
alias lr='ls++ --potsf -R' #recursive
else
alias ls='ls -F --color=auto' # colors
alias l='ls -F --group-directories-first --color=auto' # ls als Liste, Verzeichnisse ganz oben
alias ll='ls -lsah --color=auto' # long list
alias la='ls -AF --color=auto' # show hidden
# alias la='ls -Al --color=auto' # zeige versteckte Dateien in einer Liste
alias lx='ls -lXB --color=auto' # sort by extension
alias lk='ls -lSr --color=auto' # sort by size biggest last
alias lc='ls -ltcr --color=auto' # sort by and show change times
alias lu='ls -ltur --color=auto' # sort by and show access time
alias lt='ls -ltr --color=auto' # sort by date
alias lm='ls -al --color=always |more' # pipe through more, preserve colors
alias lr='ls -lR --color=always |more' # recursive
fi
#
#--------------------------------------------------------------------------------
# File Management
alias del='mv --target-directory=$HOME/.Trash/'
alias rm='rm -iv'
alias cp='cp -iv'
alias mv='mv -iv'
#--------------------------------------------------------------------------------
# MISC & STUFF
# alias tree='tree -Csu|more' # Alternative zum rekursiven ls; Für Tree noch Befehl "sudo apt-get install tree"
alias ping='ping -c 3' # 3 pings
#alias beep='echo -en "\x07"' # beep
alias cls='clear' # clears the terminal window
alias which='type -a' # usage 'wich name' (consider using 'wtfis' instead, since it exposes more info about the file)
alias du='du -kh --max-depth=1' # readable output
alias df='df -kTh' # ^ ^
# alias psa='ps auxf'
# alias pg='ps aux | grep' # Prozess greppen -> pg name
alias home='cd ~' # change to the current users home directory
alias fdate='date "+%A, %d.%B %Y %T %Z"' # weekday+date+time+timezone
alias sdate='date "+%A, %d.%B %Y"' # weekday+date
alias h='history' # BASH command history
alias bashedit='nano ~/.bashrc' # replace "nano" with editor of you choice, e.g. leafpad or vim
alias reload='source ~/.bashrc' # clears terminal window and reloads .bashrc
alias ip='ip --color=auto' # colored ip-adresses
alias dir='dir --color=always'
alias vdir='vdir --color=always'
alias grep='grep --color=always'
alias fgrep='fgrep --color=always'
alias egrep='egrep --color=always'
alias dmesg='dmesg --color=always | less'
alias distver='grep -E ^VERSION= /etc/os-release'
alias distname='grep -E ^NAME= /etc/os-release'
#----------------------------------------------------------------------------------------------------
#sudo
alias si='sudo -i' # Starts a login-shell. It means all variables will be set like at login.
#----------------------------------------------------------------------------------------------------
# Directory Navigation
alias ..='cd ..'
alias ...='cd ../..'
#----------------------------------------------------------------------------------------------------
# chmod
alias mx='chmod a+x'
alias 000='chmod 000'
alias 644='chmod 644'
alias 755='chmod 755'
#----------------------------------------------------------------------------------------------------
# apt-get Shortcuts
alias ags='apt-cache search'
alias agi='sudo apt-get install' # install package
alias agr='sudo apt-get remove' # remove package
alias agar='sudo apt-get autoremove' # remove unused packages
alias agu='sudo apt-get update' # update package lists
alias agg='sudo apt-get upgrade' # install updates
# Replace "nano" with editor of you choice, e.g. leafpad or vim
alias sources='sudo nano /etc/apt/sources.list' # Don't confuse the ALIAS named "sources" with the source COMMAND
#----------------------------------------------------------------------------------------------------
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert << replace the command 'sleep 10' with a desired one
# notification will show up in the graphical environment
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
#####################################################################################################
#
# Here you can define an alias for your own script
#----------------------------------------------------------------------------------------------------
# alias ms='bash $HOME/$USER/my_script.sh'
#----------------------------------------------------------------------------------------------------
#
#####################################################################################################
#
#----------------------------------------------------------------------------------------------------
# Start X-Windows (only usefull if X is not started at boot)
alias sx='startx'
#
# Reboot gracefully
alias restart='sudo systemctl start reboot.target'
alias restart1='sudo shutdown --reboot'
#
#----------------------------------------------------------------------------------------------------
#
# END OF FILE