From for i in G M K; do du -ah | grep, 8 Months ago, written in Plain Text.
This paste is a reply to bash junk from some guy - view diff
  1. #
  2. # ~/.bashrc
  3. #
  4.  
  5. # If not running interactively, don't do anything
  6. [[ $- != *i* ]] && return
  7.  
  8. # Make colorcoding available for everyone
  9.  
  10. Black='e[0;30m'        # Black
  11. Red='e[0;31m'          # Red
  12. Green='e[0;32m'        # Green
  13. Yellow='e[0;33m'       # Yellow
  14. Blue='e[0;34m'         # Blue
  15. Purple='e[0;35m'       # Purple
  16. Cyan='e[0;36m'         # Cyan
  17. White='e[0;37m'        # White
  18.  
  19. # Bold
  20. BBlack='e[1;30m'       # Black
  21. BRed='e[1;31m'         # Red
  22. BGreen='e[1;32m'       # Green
  23. BYellow='e[1;33m'      # Yellow
  24. BBlue='e[1;34m'        # Blue
  25. BPurple='e[1;35m'      # Purple
  26. BCyan='e[1;36m'        # Cyan
  27. BWhite='e[1;37m'       # White
  28.  
  29. # Background
  30. On_Black='e[40m'       # Black
  31. On_Red='e[41m'         # Red
  32. On_Green='e[42m'       # Green
  33. On_Yellow='e[43m'      # Yellow
  34. On_Blue='e[44m'        # Blue
  35. On_Purple='e[45m'      # Purple
  36. On_Cyan='e[46m'        # Cyan
  37. On_White='e[47m'       # White
  38.  
  39. NC="e[m"               # Color Reset
  40.  
  41.  
  42. # new alert text
  43. ALERT=${BWhite}${On_Red} # Bold White on red background
  44.  
  45. # mostly used alias functions
  46.  
  47. alias cls="clear"
  48. alias ..="cd .."
  49. alias cd..="cd .."
  50. alias ls="ls -CF --color=auto"
  51. alias ll="ls -lisa --color=auto"
  52. alias lsl="ls -lhFA | less"
  53. alias home="cd ~"
  54. alias df="df -ahiT --total"
  55. alias mkdir="mkdir -pv"
  56. alias userlist="cut -d: -f1 /etc/passwd"
  57. alias fhere="find . -name "
  58. alias free="free -mt"
  59. alias du="du -ach | sort -h"
  60. alias ps="ps auxf"
  61. alias psgrep="ps aux | grep -v grep | grep -i -e VSZ -e"
  62. alias wget="wget -c"
  63. alias histg="history | grep"
  64. alias myip="curl http://ipecho.net/plain; echo"
  65. alias logs="find /var/log -type f -exec file {} ; | grep 'text' | cut -d' ' -f1 | sed -e's/:$//g' | grep -v '[0-9]$' | xargs tail -f"
  66. alias folders='find . -maxdepth 1 -type d -print0 | xargs -0 du -sk | sort -rn'
  67. alias grep='grep --color=auto'
  68.  
  69. # Creates an archive (*.tar.gz) from given directory.
  70. function maketar() { tar cvzf "${1%%/}.tar.gz"  "${1%%/}/"; }
  71.  
  72. # Create a ZIP archive of a file or folder.
  73. function makezip() { zip -r "${1%%/}.zip" "$1" ; }
  74.  
  75. function extract {
  76.  if [ -z "$1" ]; then
  77.     # display usage if no parameters given
  78.     echo "Usage: extract <path/file_name>.<zip|rar|bz2|gz|tar|tbz2|tgz|Z|7z|xz|ex|tar.bz2|tar.gz|tar.xz>"
  79.  else
  80.     if [ -f $1 ] ; then
  81.         # NAME=${1%.*}
  82.         # mkdir $NAME && cd $NAME
  83.         case $1 in
  84.           *.tar.bz2)   tar xvjf ../$1    ;;
  85.           *.tar.gz)    tar xvzf ../$1    ;;
  86.           *.tar.xz)    tar xvJf ../$1    ;;
  87.           *.lzma)      unlzma ../$1      ;;
  88.           *.bz2)       bunzip2 ../$1     ;;
  89.           *.rar)       unrar x -ad ../$1 ;;
  90.           *.gz)        gunzip ../$1      ;;
  91.           *.tar)       tar xvf ../$1     ;;
  92.           *.tbz2)      tar xvjf ../$1    ;;
  93.           *.tgz)       tar xvzf ../$1    ;;
  94.           *.zip)       unzip ../$1       ;;
  95.           *.Z)         uncompress ../$1  ;;
  96.           *.7z)        7z x ../$1        ;;
  97.           *.xz)        unxz ../$1        ;;
  98.           *.exe)       cabextract ../$1  ;;
  99.           *)           echo "extract: '$1' - unknown archive method" ;;
  100.         esac
  101.     else
  102.         echo "$1 - file does not exist"
  103.     fi
  104. fi
  105. }
  106.  
  107. # jump directorys upwards until it hits a directory with multiple folders
  108. up(){
  109.   local d=""
  110.   limit=$1
  111.   for ((i=1 ; i <= limit ; i++))
  112.     do
  113.       d=$d/..
  114.     done
  115.   d=$(echo $d | sed 's/^///')
  116.   if [ -z "$d" ]; then
  117.     d=..
  118.   fi
  119.   cd $d
  120. }
  121.  
  122. # create an directory and directly cd into it
  123. mcd () {
  124.   mkdir -p $1
  125.   cd $1
  126. }
  127.  
  128. # set PATH so it includes user's private bin directories
  129. PATH="$HOME/bin:$HOME/.local/bin:$PATH"
  130.  
  131. export PS1="[33[38;5;12m][[$(tput sgr0)][33[38;5;10m]u[$(tput sgr0)][33[38;5;12m]@[$(tput sgr0)][33[38;5;7m]h[$(tput sgr0)][33[38;5;12m]][$(tput sgr0)][33[38;5;15m]: [$(tput sgr0)][33[38;5;7m]w[$(tput sgr0)][33[38;5;12m]>[$(tput sgr0)][33[38;5;10m]\$[$(tput sgr0)][33[38;5;15m] [$(tput sgr0)]"
  132.  
  133. [ -e "/etc/DIR_COLORS" ] && DIR_COLORS="/etc/DIR_COLORS"
  134. [ -e "$HOME/.dircolors" ] && DIR_COLORS="$HOME/.dircolors"
  135. [ -e "$DIR_COLORS" ] || DIR_COLORS=""
  136. eval "`dircolors -b $DIR_COLORS`"
  137. #hostnamectl
  138. archey3
  139.  
  140.  

Replies to Re: bash junk rss

Title Name Language When
Re: Re: bash junk Diminutive Lizard text 8 Months ago.
captcha