Ralf Beckesch 2 주 전
부모
커밋
6d8348e709
1개의 변경된 파일과 88개의 추가작업 그리고 3개의 파일을 삭제
  1. 88 3
      dot_bashrc

+ 88 - 3
dot_bashrc

@@ -165,11 +165,96 @@ fi
 
 # 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'
-fi
+	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'
+
+# Generate sha1 digest
+alias sha1='openssl sha1'
+
+# 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'