- status() {
- echo -e "\n\e[33mMachine System:\e[0m" ; lsb_release -d
- echo -e "\n\e[33mMachine information:\e[0m" ; uname -a
- echo -e "\n\e[33mUsers logged on:\e[0m" ; w -h
- echo -e "\n\e[33mCurrent date:\e[0m" ; date
- echo -e "\n\e[33mMachine status:\e[0m" ; uptime
- echo -e "\n\e[33mMemory status:\e[0m" ; free -m
- echo -e "\n\e[33mFilesystem status:\e[0m"; df -h
- }
- extract ()
- {
- if [ -f $1 ] ; then
- case $1 in
- *.tar.bz2) tar xjf $1 ;;
- *.tar.gz) tar xzf $1 ;;
- *.bz2) bunzip2 $1 ;;
- *.rar) rar x $1 ;;
- *.gz) gunzip $1 ;;
- *.tar) tar xf $1 ;;
- *.tbz2) tar xjf $1 ;;
- *.tgz) tar xzf $1 ;;
- *.zip) unzip $1 ;;
- *.Z) uncompress $1;;
- *.7z) 7z x $1 ;;
- *) echo "'$1' cannot be extracted via ex()" ;;
- esac
- else
- echo "'$1' is not a valid file"
- fi
- }
- netinfo ()
- {
- echo "--------------- Network Information ---------------"
- /sbin/ifconfig | awk /'inet addr/ {print $2}'
- /sbin/ifconfig | awk /'Bcast/ {print $3}'
- /sbin/ifconfig | awk /'inet addr/ {print $4}'
- /sbin/ifconfig | awk /'HWaddr/ {print $4,$5}'
- myip=`lynx -dump -hiddenlinks=ignore -nolist http://checkip.dyndns.org:8245/ | sed '/^$/d; s/^[ ]*//g; s/[ ]*$//g' `
- echo "${myip}"
- echo "---------------------------------------------------"
- }
- #dirsize - finds directory sizes and lists them for the current directory
- dirsize ()
- {
- du -shx * .[a-zA-Z0-9_]* 2> /dev/null | \
- egrep '^ *[0-9.]*[MG]' | sort -n > /tmp/list
- egrep '^ *[0-9.]*M' /tmp/list
- egrep '^ *[0-9.]*G' /tmp/list
- rm -rf /tmp/list
- }
Recent Pastes