Nethence Newdoc Olddoc Lab Your IP BBDock  

Setting up GNU/Screen

Setup system-wide,

cp -pi /etc/screenrc /etc/screenrc.dist
vi /etc/screenrc

startup_message off
caption always "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"
shelltitle ""

#fr keyboard alt+, alt+;
bindkey ^[, prev
bindkey ^[; next

Note. other key bindings,

#console F9, F12
bindkey ^[[20~ prev
bindkey ^[[24~ next

Note. other values allowed for caption,

caption always "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%< %{=b BW} %H %{-} %l %c %Y-%m-%d"
%D %M %d %c

Setup wheeled specific log views

user=WHEELED
su - $user
vi .screenrc

for CentOS,

screen -t "log" 0 tail -n 100 -F /var/log/messages
screen -t "mail" 1 tail -n 100 -F /var/log/maillog
screen -t "access" 2 sh -c "tail -n 100 -F /var/log/httpd/*access*log"
screen -t "error" 3 sh -c "tail -n 100 -F /var/log/httpd/*error*log"

note. need to use sh -c for wildcards

for Debian,

screen -t "log" 0 tail -n 100 -F /var/log/messages
screen -t "exim" 1 tail -n 100 -F /var/log/exim4/mainlog
screen -t "access" 2 sh -c "tail -n 100 -F /var/log/apache2/*access*log"
screen -t "error" 3 sh -c "tail -n 100 -F /var/log/apache2/*error*log"

for Ubuntu,

screen -t "log" 0 tail -n 100 -F /var/log/syslog
screen -t "mail" 1 tail -n 100 -F /var/log/mail.log
screen -t "access" 2 sh -c "tail -n 100 -F /var/log/apache2/*access*log"
screen -t "error" 3 sh -c "tail -n 100 -F /var/log/apache2/*error*log"

and eventually add other shit,

screen -t "mongo" 1 tail -n 100 -F /var/log/mongodb/mongod.log

Home | GitHub | Donate | Feedback