While you can log everything with screen’s logging functionality, or tee it to some file, you can also use script.
Script makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an inter‐active session as proof of an assignment, as the typescript file can be printed out later with lpr(1).
% script foo
Script started, file is foo
% ps
PID TTY TIME CMD
11448 pts/3 00:00:00 zsh
11511 pts/3 00:00:00 ps
%
Script done, file is foo
% cat foo
Script started on Fri Jun 18 10:13:14 2010
% ps
PID TTY TIME CMD
11448 pts/3 00:00:00 zsh
11511 pts/3 00:00:00 ps
% <ctrl +d>
Script done on Fri Jun 18 10:13:25 2010
</ctrl>
somehow I missed this very handy tool.
http://en.wikipedia.org/wiki/Expect
http://floppsie.comp.glam.ac.uk/Glamorgan/gaius/scripting/5.html
Add to .screenrc
bindkey "^[[5;2~" eval "copy" "stuff ^u"
bindkey -m "^[[5;2~" stuff ^u
bindkey -m "^[[6;2~" stuff ^d
keycode 63 = Alt_L
keycode 71 = Alt_R
keycode 66 = Super_L
keycode 69 = Super_R
clear mod1
clear mod2
add mod1 = Alt_L
add mod1 = Alt_R
add mod4 = Super_L
add mod4 = Super_R
keycode 75 = asterisk
keycode 77 = plus
Fire up xmodmap somewhere. .xinitrc
or .bash_profile
http://www.commandlinefu.com/commands/browse/sort-by-votes
this annoys me all the time
xmodmap -e "remove lock = Caps_Lock"
type the following to turn on line numbers:
enter the following command to turn them off:
bash_prompt_command() {
# How many characters of the $PWD should be kept
local pwdmaxlen=55
# Indicate that there has been dir truncation
local trunc_symbol=".."
local dir=${PWD##*/}
pwdmaxlen=$(( ( pwdmaxlen < ${#dir} ) ? ${#dir} : pwdmaxlen ))
NEW_PWD=${PWD/$HOME/~}
local pwdoffset=$(( ${#NEW_PWD} - pwdmaxlen ))
if [ ${pwdoffset} -gt "0" ]; then
NEW_PWD=${NEW_PWD:$pwdoffset:$pwdmaxlen}
NEW_PWD=${trunc_symbol}/${NEW_PWD#*/}
fi
}
bash_prompt() {
if [ -n "$PS1" ]; then
PS1="$XTITLE""\033[01;32m\][\!][\u@]\[\033[01;34m\] \${NEW_PWD}\n >\\$\[\033[00m\] "
fi
}
display the number of cols from within bash:
$ tput cols
80
Code snippets, Unix, Programming.