alexander Posted November 24, 2009 Report Posted November 24, 2009 So linux has this great fun feature for admins called motd, its just message of the day, and its a file in /etc that gets catted on user login. So, me being subtle me, i decided to put something actually useful in motd, to hint to users that they should not leave random screen sessions open all the time, and ended with writing this small bash script to make it all happen[noparse] echo -e "033[1;31m***************************************************************************************************033[0m" > motd echo -e "033[1;31m*033[0m 033[1;31m[sCREEN]033[0m 033[1;31m*033[0m" >> motd echo -e "033[1;31m* *033[0m" >> motd echo -e "033[1;31m*033[0m 033[1;35m{commands}033[0m 033[1;31m*033[0m" >> motd echo -e "033[1;31m*033[0m 033[0;37mscreen -list - lists screen sessions033[0m 033[1;31m*033[0m" >> motd echo -e "033[1;31m*033[0m 033[0;37mscreen -r [name] or screen -r [id] - reattaches to a detached screen session033[0m 033[1;31m*033[0m" >> motd echo -e "033[1;31m*033[0m 033[0;37mscreen -x [name] or screen -x [id] - reattaches to any screen session033[0m 033[1;31m*033[0m" >> motd echo -e "033[1;31m*033[0m 033[0;37mscreen -dmS [name] - start a detached screen session (named)033[0m 033[1;31m*033[0m" >> motd echo -e "033[1;31m* *033[0m" >> motd echo -e "033[1;31m*033[0m 033[1;35m{shortcuts}033[0m 033[1;31m*033[0m" >> motd echo -e "033[1;31m*033[0m 033[0;37mCtrl d - logout of current screen and kill it033[0m 033[1;31m*033[0m" >> motd echo -e "033[1;31m*033[0m 033[0;37mCtrl a + d - detatch from a screen session (what you should do most of the time)033[0m 033[1;31m*033[0m" >> motd echo -e "033[1;31m*033[0m 033[0;37mCtrl a + c - create new window033[0m 033[1;31m*033[0m" >> motd echo -e "033[1;31m*033[0m 033[0;37mCtrl a + " - list windows in current screen (select switch)033[0m 033[1;31m*033[0m" >> motd echo -e "033[1;31m*033[0m 033[0;37mCtrl a + a - quickly switch to the next window in current screen033[0m 033[1;31m*033[0m" >> motd echo -e "033[1;31m*033[0m 033[0;37mCtrl a + # (0-9) - switch to a specific screen033[0m 033[1;31m*033[0m" >> motd echo -e "033[1;31m*033[0m 033[0;37mCtrl a + ? - help033[0m 033[1;31m*033[0m" >> motd echo -e "033[1;31m*033[0m 033[0;37mCtrl a + S - split screen033[0m 033[1;31m*033[0m" >> motd echo -e "033[1;31m*033[0m 033[0;37mCtrl a + TAB - switch between split screens033[0m 033[1;31m*033[0m" >> motd echo -e "033[1;31m*033[0m 033[0;37mCtrl a + Q (yes capital) - kill all split screens but the current one (this keeps the windows)033[0m 033[1;31m*033[0m" >> motd echo -e "033[1;31m*033[0m 033[0;37mCtrl a + X - remove current window from split033[0m 033[1;31m*033[0m" >> motd echo -e "033[1;31m* *033[0m" >> motd echo -e "033[1;31m***************************************************************************************************033[0m" >> motd[/noparse]generages a perdy motd of this sort: Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.