Skip to content

Instantly share code, notes, and snippets.

@flatlinebb
Last active March 15, 2024 01:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flatlinebb/44bd8de68a9cb2862c8ac846b0ce2400 to your computer and use it in GitHub Desktop.
Save flatlinebb/44bd8de68a9cb2862c8ac846b0ce2400 to your computer and use it in GitHub Desktop.
bash.rc login info
# Display some useful info at login
echo
# Display your IP hostname & IP addresses
#echo
echo " -------------------------------------------------------------------"
echo " Hostname: `hostname`"
#echo " Your IPv4 Address: `ifconfig | grep 'inet addr:' | grep -v 127.0.0.1 | grep -v 10.32. | grep -v 192.168. | cut -d: -f2 | cut -d' ' -f1`"
echo " Your IPv4 Address: `ip a | grep eth0 | grep inet | cut -d' ' -f8`"
echo " Your IPv6 Address: `ip a | grep inet6 | grep global | cut -d' ' -f6`"
echo
echo " System information as of `date`"
echo " `uptime`"
# Display Disk Usage at login
echo
echo " -------------------------------------------------------------------"
echo " Your disk usage in /home/`whoami`:"
echo " `/usr/bin/du ~/ --si -s | awk '{printf $1} END {print "B out of 2.9TB"}'`"
echo
# Display total disk space on /home
echo " Total disk space on server:"
echo " `df -Hl | grep --color=never Filesystem`"
echo " `df -Hl | grep --color=never md1`"
echo " `df -Hl | grep --color=never md2`"
#echo " `df -Hl | grep --color=never rootfs`"
echo " `df -Hl | grep --color=never home`"
echo " -------------------------------------------------------------------"
echo
# Display active screen sessions
echo " Your active screen sessions:"
echo "`screen -ls | grep -v There | grep -v Sockets > screen_list`"
echo "`cat screen_list | grep -v Socket`"
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment