Custom Raspberry Pi

The startup sequence of the Bash shell is as follows:

Order of Execution:

/etc/profile (file)
....PATH=...
..../etc/bash.bashrc
..../etc/profile.d/*.sh
..../etc/motd.sh

/etc.bash.bashrc
/etc.profile.d/*.sh
....bash_completion.sh

# Filename: motd.sh
# Location: /etc/motd.sh
#!/bin/bash
#clear
diskused=`df -h | grep 'dev/root' | awk '{print $3}'`
diskfree=`df -h | grep 'dev/root' | awk '{print $4}'`

echo -ne '\033[0;32m' "   .~~.   .~~.    " '\033[1;32m' "Date:            " && whatday
echo -ne '\033[0;32m' "  '. \ ' ' / .'   " '\033[1;32m' "Time:            " && whattime
echo -e '\033[0;31m' "   .~ .~~~..~.    " '\033[1;31m' 
echo -ne '\033[0;31m' "  : .~.'~'.~. :   " '\033[1;31m' "IP Address:      " && ip addr show scope global | grep inet | cut -d' ' -f6 | cut -d/ -f1
echo -ne '\033[0;31m' " ~ (   ) (   ) ~  " '\033[1;31m' "CPU Frequency:   " && awk '{printf("%.0f MHz\n", $1/1e3)}' /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
echo -ne '\033[0;31m' "( : '~'.~.'~' : ) " '\033[1;31m' "CPU Temperature: " && cputemp
echo -ne '\033[0;31m' " ~ .~ (   ) ~. ~  " '\033[1;31m' "Up Time:        " && uptime | cut -d'p' -f2 | cut -d',' -f1
echo -e '\033[0;31m' "  (  : '~' :  )   " '\033[1;31m' "Disk Used:       " $diskused
echo -e '\033[0;31m' "   '~ .~~~. ~'    " '\033[1;31m' "Disk Free:       " $diskfree
echo -ne '\033[0;31m' "       '~'        " '\033[1;31m' "Free Memory:     " && cat /proc/meminfo | grep MemFree | awk '{print $2, $3}'
echo -e '\033[0;0m'

unset diskused diskfree


# Filename: cputemp
# Location: /usr/local/bin/cputemp
# This script outputs the current CPU temperature in degrees Celcius and Farenheit
#
#!/bin.bash
awk '{printf("%.1fC ",$1/1e3)}' /sys/class/thermal/thermal_zone0/temp
awk '{printf("(%.1fF)\n",$1*1.8/1e3)}' /sys/class/thermal/thermal_zone0/temp


# Filename: whatday
# Location: /usr/local/bin/whatday
# Display date as '[name of day], [name of month] [date day], [four digit year]'
# Saturday, February 28, 2015
#
#!/bin.bash
date '+%A, %B %d, %Y'


# Filename: whattime
# Location: /usr/local/bin/whattime
# Display time as ' [hour with no leading zeros]:[minutes] [lower case am/pm] '
# 1:23pm
#
#!/bin/bash
date '+%l:%M %P'


~/.bash_profile
....~/.profile

~/.profile
....~/.bashrc

~/.bashrc
....sets custom prompt PS1
....sets some standard aliases defining colors for certain commands
....~/.bash_aliases

# Filename: .bash_aliases
# Location: /~
#
# Roughly equivalent to "dir /o:gn /p" in DOS
alias dir='ls --color=always --group-directories-first -laFh | more -d'

alias cls='clear'
alias cd..='cd ..'
alias cd~='cd ~'

#
# DOS command alternatives:
#
alias md='echo Use "mkdir" instead'
alias rd='echo Use "rmdir" instead'
alias del='echo Use "rm -iv" instead'
alias move='echo Use "mv -iv" instead'
alias ren='echo Use "mv -v" instead'
alias copy='echo Use "cp -piv" instead'
alias type='echo Use "cat" instead'
alias mem='echo Use "free" instead'


000webhost logo