How to record a command line session to a file?
I recently borked my video driver with a series of upgrades and found my system booting to the TTY with no access to the desktop, graphical login, or even X. I spent some days troubleshooting the problem and experimenting with possible fixes. I found myself wishing for some way to copy and paste from the TTY, or at least log all input and output to a file.
I have considered that something like this might lead to a solution: Code:
# bash 2>&1 | tee /tty-session.log Does anyone have nice solution? |
@ Reply
Hi there,
Check out the following links: http://www.cyberciti.biz/faq/list-co...n-linuxserver/ http://www.cyberciti.biz/tips/howto-...ccounting.html |
psacct seems a little heavy. I'm not after forensic analysis and accounting.
Suppose in a command line only session (no desktop, no X, just me and TTY1 and bash) I did something like this: Code:
grep -i 'nouveau' /var/log/Xorg.0.log Code:
sudo find / -name 'nvidia*' -print -delete In Konsole I have tons of scrollback and I can easily copy and paste with my mouse. Not so with the TTY without X. |
@ Reply
Then you can use script command to capture the activities going on, on your terminal. For more info check out this link: https://knowledgecenter.citrix.com/article/CTX116378
|
Quote:
http://manpages.ubuntu.com/manpages/...treplay.1.html Hmm ... this is actually quite nice :) Code:
foo$ ls |
@ Reply
When you say copy and paste I am assuming that you want to copy a particular file or directory or directory with subdirectory to a particular location. If that is the case then you can go with the following commands:
cp -arvp /root/test /tmp The above command will work on both when test is a file or when test is a directory, this will copy over test file or directory from /root to /tmp. Good thing about using all these switches (-arvp) is that it will copy over hidden files as well. Where, a=all (including hidden) r=recursive v=verbose p=preserve permissions Edit: I just realized that you might be pointing to copying and pasting commands as we can do in X console. Well that will not be possible when you are working on CLI without X. |
All times are GMT -5. The time now is 06:49 PM. |