Tip #483 /dev/vcs and /dev/tty
Have you ever wanted to check the content of the first virtual console without switching to it with "Ctrl+Alt+F1"? Or the second console of a remote server? Or would you like to send something to the user working at the third virtual console (not via wall command)?The GNU/Linux kernel provides two character devices for such tasks:
* /dev/ttyX - represents X. virtual console
* /dev/vcsX - represents X. virtual console text contents
So, to answer the questions use these commands:
1. cat /dev/vcs1
2. ssh root@server 'cat /dev/vcs2'
3. echo "something" > /dev/tty3
- TAGS:
alias aptitude at awk bash bc cal cat cd colrm comm cp csh curl cut date dd df dialog diff dirname dpkg du fc find fuser grep gs gzip history iconv kill ksh last less ln ls lsof lynx m4 md5sum mkdir mkfifo mkisofs mv mysql nc netstat openssl OSX perl ping popd ps pushd python read redirection rm scp screen sed sort ssh stat sudo svn tail tar tee test top tr uniq vim wc wget xargs