Nethence Newdoc Olddoc Lab Your IP BBDock  

Setting up GNU/Screen

Configuration

Setup system-wide,

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

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

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

# us 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 %Y-%m-%d-%c"
%D e.g. Thu
%M e.g. Sep
%d e.g. 05
%c e.g. 12:38

Setup wheeled specific log views

user=WHEELED
su - $user
vi .screenrc

note. need to use sh -c for wildcards

on 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 "selinux" 2 tail -n 100 -F /var/log/audit/audit.log
#screen -t "web" 3 sh -c "tail -F /var/log/nginx/*.log"
#screen -t "access" X sh -c "tail -n 100 -F /var/log/httpd/*access*log"
#screen -t "error" X sh -c "tail -n 100 -F /var/log/httpd/*error*log"

on 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 "web" 2 sh -c "tail -F /var/log/nginx/*.log"
#screen -t "access" X sh -c "tail -n 100 -F /var/log/apache2/*access*log"
#screen -t "error" X sh -c "tail -n 100 -F /var/log/apache2/*error*log"

plus on Ubuntu Desktop,

screen -t "all" 3 sudo su -l -c "tail -n 0 -F /var/log/*"
screen -t "root" 4 sudo su -
screen -t "sys" 5

on 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 "web" 2 sh -c "tail -F /var/log/nginx/*.log"
#screen -t "access" X sh -c "tail -n 100 -F /var/log/apache2/*access*log"
#screen -t "error" X sh -c "tail -n 100 -F /var/log/apache2/*error*log"

for NGINX with the /usr/local/nginx/ from scratch default prefix,

#screen -t "access" X sh -c "tail -n 100 -F /usr/local/nginx/logs/*access*log"
#screen -t "error" X sh -c "tail -n 100 -F /usr/local/nginx/logs/*error*log"

and eventually some other shit,

#screen -t "postfixprod" 4 docker exec -ti postfixprod tail -F /var/log/mail.err /var/log/mail.log
#screen -t "mongo" 1 tail -n 100 -F /var/log/mongodb/mongod.log
#screen -t "tomcat" 2 sh -c "tail -F /var/log/tomcat8/*"

Operations

To name a screen SESSION,

screen -S SESSION_NAME

To rename a screen SESSION,

^a :session SESSION_NAME

Home | GitHub | Donate | Contact