| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- # Add your generic aliases here
- # (may be they are overwritten by later loaded scripts...)
- alias ls='ls --color=auto'
- alias grep='grep --color=auto'
- # some more ls aliases
- #alias ll='ls -l'
- #alias la='ls -A'
- #alias l='ls -CF'
- ## if user is not root, pass all commands via sudo #
- if [ $UID -ne 0 ]; then
- alias reboot='sudo reboot'
- alias update='sudo apt-get upgrade'
- alias apt-get="sudo apt-get"
- alias updatey="sudo apt-get --yes"
- # update on one command
- alias update='sudo apt-get update && sudo apt-get upgrade'
- fi
- ## cd specific
- ## get rid of command not found ##
- alias cd..='cd ..'
- ## a quick way to get out of current directory ##
- alias ..='cd ..'
- alias ...='cd ../../../'
- alias ....='cd ../../../../'
- alias .....='cd ../../../../'
- alias .4='cd ../../../../'
- alias .5='cd ../../../../..'
- ## Colorize the grep command output for ease of use (good for log files)##
- alias grep='grep --color=auto'
- alias egrep='egrep --color=auto'
- alias fgrep='fgrep --color=auto'
- ## Create parent directories on demand
- #alias mkdir='mkdir -pv'
- ## Make mount command output pretty and human readable format
- # alias mount='mount |column -t'
- ## Command short cuts to save time
- #alias h='history'
- #alias j='jobs -l'
- ## Create a new set of commands
- #alias path='echo -e ${PATH//:/\\n}'
- alias now='date +"%T"'
- alias nowtime=now
- alias nowdate='date +"%d-%m-%Y"'
- ## Set vim as default
- #alias vi=vim
- #alias svi='sudo vi'
- #alias vis='vim "+set si"'
- #alias edit='vim'
- ## Control output of networking tool called ping
- ## Stop after sending count ECHO_REQUEST packets #
- #alias ping='ping -c 5'
- ## Do not wait interval 1 second, go fast #
- #alias fastping='ping -c 100 -s.2'
- ## Show open ports
- ## Use netstat command to quickly list all TCP/UDP port on the server:
- #alias ports='netstat -tulanp'
- ## Add safety nets
- ## do not delete / or prompt if deleting more than 3 files at a time #
- # alias rm='rm -I --preserve-root'
- ## confirmation
- #alias mv='mv -i'
- #alias cp='cp -i'
- #alias ln='ln -i'
- ## Parenting changing perms on / #
- #alias chown='chown --preserve-root'
- #alias chmod='chmod --preserve-root'
- #alias chgrp='chgrp --preserve-root'
- ## Get system memory, cpu usage, and gpu memory info quickly
- ## pass options to free
- alias meminfo='free -m -l -t'
- ## get top process eating memory
- #alias psmem='ps auxf | sort -nr -k 4'
- #alias psmem10='ps auxf | sort -nr -k 4 | head -10'
- ## get top process eating cpu ##
- #alias pscpu='ps auxf | sort -nr -k 3'
- #alias pscpu10='ps auxf | sort -nr -k 3 | head -10'
- ## Get server cpu info ##
- #alias cpuinfo='lscpu'
- ## older system use /proc/cpuinfo ##
- #alias cpuinfo='less /proc/cpuinfo' ##
- ## get GPU ram on desktop / laptop##
- #alias gpumeminfo='grep -i --color memory /var/log/Xorg.0.log'
|