编辑自己用户下的 .bash_profile文件
创新互联是一家以网站设计建设,成都小程序开发、网站开发设计,网络软件产品开发,企业互联网推广服务为主的民营科技公司。主要业务涵盖:为客户提供网站策划、网站设计、网站开发、域名注册、网站优化排名、买友情链接等服务领域。凭借建站老客户口碑做市场,建设网站时,根据市场搜索规律和搜索引擎的排名收录规律编程,全力为建站客户设计制作排名好的网站,深受老客户认可和赞誉。# .bash_profile
#export
PS1="\n\e[1;32m[\e[0;31m\u\e[0;34m@\e[0;31m\h\e[1;32m]\e[1;32m[\e[0;34m\w\e[1;32m]$"
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
#User specific environment and startup programs
PATH=$PATH:$HOME/bin:/usr/bin/:/usr/local/bin:/usr/sbin:/sbin
export PATH
unset USERNAME
umask 022
#Custom DJRavine Modification
login_pwd=`pwd`;
login_data=`date`;
login_users=`users`;
logic_uptime=`uptime`;
server_ip=`/sbin/ifconfig |grep 'inet addr:'|grep -v '127.0.0.1'|head -1|cut -d: -f2|awk '{print $1}'`;
disk_available=$(df -h --block-size=1024|awk '{ sum += $4; } END {print sum;}');
disk_used=$(df -h --block-size=1024|awk '{ sum += $3; } END {print sum;}');
disk_size=$(df -h --block-size=1024|awk '{ sum += $2; } END {print sum;}');
disk_available_gb=$(echo "scale=2; $disk_available/(1024^2)" |bc)
disk_used_gb=$(echo "scale=2; $disk_used/(1024^2)" |bc)
disk_size_gb=$(echo "scale=2; $disk_size/(1024^2)" |bc)
red="\033[31m"
blue="\033[34m"
green="\033[32m"
echo -e " "
echo -e "${blue}+---------------------------------------------------------------"
echo -e "${green} Welcome! "
echo -e "${blue}+---------------------------------------------------------------"
echo -e " ${green}Server IP: ${red}"$server_ip
echo -e " ${green}Date: ${red}"$login_data
echo -e " ${green}Users: ${red}"$login_users
echo -e " ${green}Directory: ${red}"$login_pwd
echo -e " ${green}Uptime: ${red}"$logic_uptime
echo -e "${blue}+---------------------------------------------------------------"
echo -e " "
df -lh|column -c 6|awk '{printf "\033[22;32m%s\t%s\t\033[22;31m%s\t%s\t%s\n",$1,$6,$2,$3,$4,$5}'
echo -e " ${green}Total Disk Space: ${red}$disk_size_gb GB"
echo -e " ${green}Total Used Space: ${red}$disk_used_gb GB"
echo -e " ${green}Total Free Space: ${red}$disk_available_gb GB"
echo -e "${blue}+---------------------------------------------------------------"
PATH=$PATH:$HOME/bin
export PATH
另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
本文标题:定制自己的shell登录脚本-创新互联
浏览地址:http://lswzjz.com/article/dgpjos.html