The Linux 'script' Command: Record Your Shell Sessions

preview_player
Показать описание
A quick how-to on how to use the Linux script(1) command to record your shell sessions. Whether it's for documentation, for capturing a hard-to-replicate issue, or to prove that you've done something according a certain way, knowing the basics of the script(1) command can be extremely useful.

0:27 Common Uses
0:40 The simplest way to use the Linux script command
1:39 Inspecting script's shell log
2:06 Changing the default shell log filename
2:42 Real-time Recordings - SUPER USEFUL
3:30 Inspecting a real-time recording log
3:50 Replay a real-time script shell recording (one that was recorded with timing info)
4:45 Inspecting the Timing Log (script(1) timestamp file)
5:21 Recording shell output from a single command (useful in bash scripts, etc.)
6:46 Review of commands for recording and replaying Linux shell sessions
7:44 Important Note

# Simplest Way to Log Shell Sessions

# A single command

# Add timing information, so you can replay the shell session later

# Replay a captured shell session (with timing info)

Рекомендации по теме
Комментарии
Автор

Just to prevent confusion: The script(1) command shown in this video just records what you *see* in a shell session. Replaying it won't actually perform the same actions again. For example, when you start recording a shell session and create a directory, replaying that shell session won't try to create the same directory again -- it'll just show you the recorded shell output.

For actual *scripting* -- creating an executable, repeatable recipe for doing things on your system -- you want a scripting language -- Bash, Python, Perl, etc.

tutoriaLinux
Автор

This is one of those fantastic little utilities you wish you knew about earlier. Thanks for the video!

loc
Автор

One of the coolest commands i have seen in Linux yet. Awesome. Here's another use case, I'm a student and I can see myself using the 'script' command as a way to hand in an assignment. Thanks.

rory
Автор

Very useful command I will have to use it. It will help me a lot in my documentation. I have been going through your Ansible course it has saved me so much time managing multiple systems. I am still not where I want to be on my journey with it as I am using basic playbooks but I am sure it will come with time and usage. Again thank you so much for all your time and work.

htwebhost
Автор

Did not know about this neat command. Great video as usual!!!

cheuch
Автор

My god, this could've made my bash learning so much easier two years ago 7n7

dgreegmdz
Автор

Jeez, amazing! I am glad I am watching this series for tmux and script <3 (so far)

Trvgn
Автор

This is awesome! (this script command as well as your entire tutorial) As the sort-of-linux-admin in my shop, I am always running to keep up. I wish that I had known this gem, earlier. thank you, thank you, and thank you

stephanieezat-panah
Автор

The "script" directory name really confused me. At first I was trying to invoke "script script filename.log". But I also checked the proper usage with "man script" and solved the problem :) .

majabojarska
Автор

You know what, once I get the job I am looking for in Linux and AWS....party will be on me for you. Thanks for such amazing tuts.

OddBallTrails
Автор

What an amazing utility! Thanks for the beautiful explanation

krishangopal
Автор

i never actually knew this command existed. very nice, thanks.

Colddirector
Автор

Great video, straight to the point. Thanks.

Podoco_music
Автор

Fantastic tool! Really Love it! Thank you!

mauroymgch
Автор

Upgrading your video-editing skills? :D cool video, seems like a very useful command. Thanks for this and for all the other great content that you produce!

leep
Автор

I am using this tip in preparation for my Linux + Certitfication..

ajaykumark
Автор

Thanks for the useful tip, Dave!

Just wanted to add:
I've found that when I attempt to do this while ssh'd into my CentOS VM's, the format of the command is a bit different:

script myscript.log --t 2> time.log

I've tried various iterations of your suggestions above, and this is the only one that worked for me. Also, replaying the script requires that the timing file be specified first:

scriptreplay time.log myscript.log

Dunno if I'm just inputting something different/wrong. Feel free to correct/elaborate.

Love your videos, Sir!

AdilLeghari
Автор

Wow! you're awesome!! THANKS SO MUCH!! :D I didn't know that I could do something like this.

emmanuellazarte
Автор

Thanks @tutorialLinux, handy to know : }

kevinjones
Автор

Cool, thanks. I am teaching my two teenage boys how to use Linux and easter eggs like this are great.

shnoikle.