Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. #-------------------------------------------------------------
  2. # Prompt
  3. #-------------------------------------------------------------
  4.  
  5. PS1="\[\033[40m\]\[\033[1;32m\]\$(date +%H:%M:%S) \u@\h \w$ "
  6.  
  7.  
  8. #-------------------
  9. # Personal Aliases
  10. #-------------------
  11.  
  12. alias rm='rm -i'
  13. alias cp='cp -i'
  14. alias mv='mv -i'
  15. alias mkdir='mkdir -p'
  16. alias du='du -kh'
  17. alias df='df -kTh'
  18.  
  19. alias ll="ls -l --group-directories-first"
  20. alias ls='ls -hal' # add colors for filetype recognition
  21. alias la='ls -Al' # show hidden files
  22. alias lx='ls -lXB' # sort by extension
  23. alias lk='ls -lSr' # sort by size, biggest last
  24. alias lc='ls -ltcr' # sort by and show change time, most recent last
  25. alias lu='ls -ltur' # sort by and show access time, most recent last
  26. alias lt='ls -ltr' # sort by date, most recent last
  27. alias lm='ls -al |more' # pipe through 'more'
  28. alias lr='ls -lR' # recursive ls
  29. alias tree='tree -Csu' # nice alternative to 'recursive ls'
  30.  
  31.  
  32. function extract() # Handy Extract Program.
  33. {
  34. if [ -f $1 ] ; then
  35. case $1 in
  36. *.tar.bz2) tar xvjf $1 ;;
  37. *.tar.gz) tar xvzf $1 ;;
  38. *.bz2) bunzip2 $1 ;;
  39. *.rar) unrar x $1 ;;
  40. *.gz) gunzip $1 ;;
  41. *.tar) tar xvf $1 ;;
  42. *.tbz2) tar xvjf $1 ;;
  43. *.tgz) tar xvzf $1 ;;
  44. *.zip) unzip $1 ;;
  45. *.Z) uncompress $1 ;;
  46. *.7z) 7z x $1 ;;
  47. *) echo "'$1' cannot be extracted via >extract<" ;;
  48. esac
  49. else
  50. echo "'$1' is not a valid file"
  51. fi
  52. }
  53.  
  54.  
  55. function ii() # Get current host related info.
  56. {
  57. echo -e "\nAdditional information:$NC " ; uname -a
  58. echo -e "\n${RED}Users logged on:$NC " ; w -h
  59. echo -e "\n${RED}Current date :$NC " ; date
  60. echo -e "\n${RED}Machine stats :$NC " ; uptime
  61. echo -e "\n${RED}Memory stats :$NC " ; free
  62. echo -e "\n${RED}Open connections :$NC "; netstat -pan --inet;
  63. echo
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement