Configure Your Own screenrc file

screenrc

There are few shell scripts I need to run when I log on to my server. One of my favorite is to use screen to launch the scripts when I log on to the server or using screen to access multiple screen. screenrc file does help me on this, I can build my own screenrc file and update screenrc file whenever I have new script or command wanted to run when I log on to the server. Here is how I configure your personal screenrc file.

By default, screen will read .screenrc file (if you have one) in your home directory. But sometime you might use screen to do other stuff/work, a simple example of write your own screen. Create a screenrc file, for example I created a screenrc file name grabdata.screenrc, and the content of the file


screen -t google.com lynx http://www.google.com
screen -t myemail mutt /mail/paul/inbox
screen -t latestlog tail -F /var/log/message
screen -t checkdiskspace sh /home/paul/script/check-disk-space.sh

After you have build your own screenrc file, launch it will this line of command


screen -S mystartup -c grabdata.screenrc

screen -S mystartup is to assign a screen name
screen -c grabdata.screenrc is to launch screen command with your screenrc file

There are others stuff you can do with screenrc file, man for more info.

Related posts:

  1. Open file and Splitting String in Perl What I gonna do is to read a bunch of...
  2. Check DNS Record with Dig Command Check DNS Record with Dig Command How do you find...
  3. Configure IPV6 on Apple and Windows Do you have IPV6 network ready in your office?...
  4. Changing File’s Date and Time on Unix Systems Change Data and Time of a File At times, we...
  5. mount hfsplus (mac os file system) under Debian linux Have an external hard disk with hfsplus or hfs+ partition...

Leave a Reply