{"id":78,"date":"2008-09-17T00:29:00","date_gmt":"2008-09-17T00:29:00","guid":{"rendered":"http:\/\/wp.neependra.net\/?p=78"},"modified":"2008-09-17T00:29:00","modified_gmt":"2008-09-17T00:29:00","slug":"how-do-log-every-thing-printed-on-the-terminal","status":"publish","type":"post","link":"https:\/\/neependra.net\/index.php\/2008\/09\/17\/how-do-log-every-thing-printed-on-the-terminal\/","title":{"rendered":"How do log every thing printed on the terminal"},"content":{"rendered":"<p>Sometimes we just keep working on a terminal and get lost what all we did.<br \/>Isn&#8217;t it good if we can get some kind of logs which can give us all steps we followed.<\/p>\n<p>First thing which comes in mind is the &#8220;history&#8221; command, but that will not give the standard outputs which we got after running the commands.<\/p>\n<p>So, here is the solution.Use a command called &#8220;script&#8221;.<\/p>\n<p>e.g.<\/p>\n<p><span style=\"font-style: italic;\">$ script standard_out.txt<\/span><br \/><span style=\"font-style: italic;\">Script started, file is standard_out.txt<\/span><br \/><span style=\"font-style: italic;\">$ date<\/span><br \/><span style=\"font-style: italic;\">Mon Sep  8 07:57:20 IST 2008<\/span><br \/><span style=\"font-style: italic;\">$ asdf<\/span><br \/><span style=\"font-style: italic;\">bash: asdf: command not found<\/span><br \/><span style=\"font-style: italic;\">$ exit<\/span><br \/><span style=\"font-style: italic;\">Script done, file is standard_out.txt<\/span><br \/><span style=\"font-style: italic;\"><\/span><br \/><span style=\"font-style: italic;\">To exit you need to press &#8220;ctrl+D&#8221;.<\/span><\/p>\n<p>Now lets check the content of &#8220;standard_out.txt&#8221; file.<span style=\"font-style: italic;\"><\/p>\n<p>$ cat standard_out.txt<br \/>Script started on Mon 08 Sep 2008 07:57:10 AM IST<br \/>$ date<br \/>Mon Sep  8 07:57:20 IST 2008<br \/>$ asdf<br \/>bash: asdf: command not found<br \/>$ exit<br \/>Script done on Mon 08 Sep 2008 07:57:38 AM IST<\/p>\n<p>For more information look at the man page of  &#8221;script&#8221;&#8216;.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes we just keep working on a terminal and get lost what all we did.Isn&#8217;t it good if we can get some kind of logs which can give us all steps we followed. First thing which comes in mind is the &#8220;history&#8221; command, but that will not give the standard outputs which we got after &#8230; <a title=\"How do log every thing printed on the terminal\" class=\"read-more\" href=\"https:\/\/neependra.net\/index.php\/2008\/09\/17\/how-do-log-every-thing-printed-on-the-terminal\/\" aria-label=\"Read more about How do log every thing printed on the terminal\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[48],"tags":[134],"class_list":["post-78","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-tips-and-tricks"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"Sometimes we just keep working on a terminal and get lost what all we did.Isn&#039;t it good if we can get some kind of logs which can give us all steps we followed.First thing which comes in mind is the &quot;history&quot; command, but that will not give the standard outputs which we got after running\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Neependra\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/neependra.net\/index.php\/2008\/09\/17\/how-do-log-every-thing-printed-on-the-terminal\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Neependra Khare - Simplifier, Gardener, Trainer\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"How do log every thing printed on the terminal - Neependra Khare\" \/>\n\t\t<meta property=\"og:description\" content=\"Sometimes we just keep working on a terminal and get lost what all we did.Isn&#039;t it good if we can get some kind of logs which can give us all steps we followed.First thing which comes in mind is the &quot;history&quot; command, but that will not give the standard outputs which we got after running\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/neependra.net\/index.php\/2008\/09\/17\/how-do-log-every-thing-printed-on-the-terminal\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2008-09-17T00:29:00+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2008-09-17T00:29:00+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"How do log every thing printed on the terminal - Neependra Khare\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Sometimes we just keep working on a terminal and get lost what all we did.Isn&#039;t it good if we can get some kind of logs which can give us all steps we followed.First thing which comes in mind is the &quot;history&quot; command, but that will not give the standard outputs which we got after running\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/neependra.net\\\/index.php\\\/2008\\\/09\\\/17\\\/how-do-log-every-thing-printed-on-the-terminal\\\/#blogposting\",\"name\":\"How do log every thing printed on the terminal - Neependra Khare\",\"headline\":\"How do log every thing printed on the terminal\",\"author\":{\"@id\":\"https:\\\/\\\/neependra.net\\\/index.php\\\/author\\\/admin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/neependra.net\\\/#organization\"},\"datePublished\":\"2008-09-17T00:29:00+05:30\",\"dateModified\":\"2008-09-17T00:29:00+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/neependra.net\\\/index.php\\\/2008\\\/09\\\/17\\\/how-do-log-every-thing-printed-on-the-terminal\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/neependra.net\\\/index.php\\\/2008\\\/09\\\/17\\\/how-do-log-every-thing-printed-on-the-terminal\\\/#webpage\"},\"articleSection\":\"Uncategorized, tips and tricks\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/neependra.net\\\/index.php\\\/2008\\\/09\\\/17\\\/how-do-log-every-thing-printed-on-the-terminal\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neependra.net#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/neependra.net\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neependra.net\\\/index.php\\\/category\\\/uncategorized\\\/#listItem\",\"name\":\"Uncategorized\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neependra.net\\\/index.php\\\/category\\\/uncategorized\\\/#listItem\",\"position\":2,\"name\":\"Uncategorized\",\"item\":\"https:\\\/\\\/neependra.net\\\/index.php\\\/category\\\/uncategorized\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neependra.net\\\/index.php\\\/2008\\\/09\\\/17\\\/how-do-log-every-thing-printed-on-the-terminal\\\/#listItem\",\"name\":\"How do log every thing printed on the terminal\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neependra.net#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neependra.net\\\/index.php\\\/2008\\\/09\\\/17\\\/how-do-log-every-thing-printed-on-the-terminal\\\/#listItem\",\"position\":3,\"name\":\"How do log every thing printed on the terminal\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neependra.net\\\/index.php\\\/category\\\/uncategorized\\\/#listItem\",\"name\":\"Uncategorized\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/neependra.net\\\/#organization\",\"name\":\"neependra.net\",\"description\":\"Simplifier, Gardener, Trainer\",\"url\":\"https:\\\/\\\/neependra.net\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/neependra.net\\\/index.php\\\/author\\\/admin\\\/#author\",\"url\":\"https:\\\/\\\/neependra.net\\\/index.php\\\/author\\\/admin\\\/\",\"name\":\"Neependra\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/neependra.net\\\/index.php\\\/2008\\\/09\\\/17\\\/how-do-log-every-thing-printed-on-the-terminal\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8bfb6e08103070792590a2015c6a53adbe141a833a5cd1be04c559f3b801c346?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Neependra\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/neependra.net\\\/index.php\\\/2008\\\/09\\\/17\\\/how-do-log-every-thing-printed-on-the-terminal\\\/#webpage\",\"url\":\"https:\\\/\\\/neependra.net\\\/index.php\\\/2008\\\/09\\\/17\\\/how-do-log-every-thing-printed-on-the-terminal\\\/\",\"name\":\"How do log every thing printed on the terminal - Neependra Khare\",\"description\":\"Sometimes we just keep working on a terminal and get lost what all we did.Isn't it good if we can get some kind of logs which can give us all steps we followed.First thing which comes in mind is the \\\"history\\\" command, but that will not give the standard outputs which we got after running\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/neependra.net\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/neependra.net\\\/index.php\\\/2008\\\/09\\\/17\\\/how-do-log-every-thing-printed-on-the-terminal\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/neependra.net\\\/index.php\\\/author\\\/admin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/neependra.net\\\/index.php\\\/author\\\/admin\\\/#author\"},\"datePublished\":\"2008-09-17T00:29:00+05:30\",\"dateModified\":\"2008-09-17T00:29:00+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/neependra.net\\\/#website\",\"url\":\"https:\\\/\\\/neependra.net\\\/\",\"name\":\"neependra.net\",\"description\":\"Simplifier, Gardener, Trainer\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/neependra.net\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"How do log every thing printed on the terminal - Neependra Khare","description":"Sometimes we just keep working on a terminal and get lost what all we did.Isn't it good if we can get some kind of logs which can give us all steps we followed.First thing which comes in mind is the \"history\" command, but that will not give the standard outputs which we got after running","canonical_url":"https:\/\/neependra.net\/index.php\/2008\/09\/17\/how-do-log-every-thing-printed-on-the-terminal\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/neependra.net\/index.php\/2008\/09\/17\/how-do-log-every-thing-printed-on-the-terminal\/#blogposting","name":"How do log every thing printed on the terminal - Neependra Khare","headline":"How do log every thing printed on the terminal","author":{"@id":"https:\/\/neependra.net\/index.php\/author\/admin\/#author"},"publisher":{"@id":"https:\/\/neependra.net\/#organization"},"datePublished":"2008-09-17T00:29:00+05:30","dateModified":"2008-09-17T00:29:00+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/neependra.net\/index.php\/2008\/09\/17\/how-do-log-every-thing-printed-on-the-terminal\/#webpage"},"isPartOf":{"@id":"https:\/\/neependra.net\/index.php\/2008\/09\/17\/how-do-log-every-thing-printed-on-the-terminal\/#webpage"},"articleSection":"Uncategorized, tips and tricks"},{"@type":"BreadcrumbList","@id":"https:\/\/neependra.net\/index.php\/2008\/09\/17\/how-do-log-every-thing-printed-on-the-terminal\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/neependra.net#listItem","position":1,"name":"Home","item":"https:\/\/neependra.net","nextItem":{"@type":"ListItem","@id":"https:\/\/neependra.net\/index.php\/category\/uncategorized\/#listItem","name":"Uncategorized"}},{"@type":"ListItem","@id":"https:\/\/neependra.net\/index.php\/category\/uncategorized\/#listItem","position":2,"name":"Uncategorized","item":"https:\/\/neependra.net\/index.php\/category\/uncategorized\/","nextItem":{"@type":"ListItem","@id":"https:\/\/neependra.net\/index.php\/2008\/09\/17\/how-do-log-every-thing-printed-on-the-terminal\/#listItem","name":"How do log every thing printed on the terminal"},"previousItem":{"@type":"ListItem","@id":"https:\/\/neependra.net#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/neependra.net\/index.php\/2008\/09\/17\/how-do-log-every-thing-printed-on-the-terminal\/#listItem","position":3,"name":"How do log every thing printed on the terminal","previousItem":{"@type":"ListItem","@id":"https:\/\/neependra.net\/index.php\/category\/uncategorized\/#listItem","name":"Uncategorized"}}]},{"@type":"Organization","@id":"https:\/\/neependra.net\/#organization","name":"neependra.net","description":"Simplifier, Gardener, Trainer","url":"https:\/\/neependra.net\/"},{"@type":"Person","@id":"https:\/\/neependra.net\/index.php\/author\/admin\/#author","url":"https:\/\/neependra.net\/index.php\/author\/admin\/","name":"Neependra","image":{"@type":"ImageObject","@id":"https:\/\/neependra.net\/index.php\/2008\/09\/17\/how-do-log-every-thing-printed-on-the-terminal\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/8bfb6e08103070792590a2015c6a53adbe141a833a5cd1be04c559f3b801c346?s=96&d=mm&r=g","width":96,"height":96,"caption":"Neependra"}},{"@type":"WebPage","@id":"https:\/\/neependra.net\/index.php\/2008\/09\/17\/how-do-log-every-thing-printed-on-the-terminal\/#webpage","url":"https:\/\/neependra.net\/index.php\/2008\/09\/17\/how-do-log-every-thing-printed-on-the-terminal\/","name":"How do log every thing printed on the terminal - Neependra Khare","description":"Sometimes we just keep working on a terminal and get lost what all we did.Isn't it good if we can get some kind of logs which can give us all steps we followed.First thing which comes in mind is the \"history\" command, but that will not give the standard outputs which we got after running","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/neependra.net\/#website"},"breadcrumb":{"@id":"https:\/\/neependra.net\/index.php\/2008\/09\/17\/how-do-log-every-thing-printed-on-the-terminal\/#breadcrumblist"},"author":{"@id":"https:\/\/neependra.net\/index.php\/author\/admin\/#author"},"creator":{"@id":"https:\/\/neependra.net\/index.php\/author\/admin\/#author"},"datePublished":"2008-09-17T00:29:00+05:30","dateModified":"2008-09-17T00:29:00+05:30"},{"@type":"WebSite","@id":"https:\/\/neependra.net\/#website","url":"https:\/\/neependra.net\/","name":"neependra.net","description":"Simplifier, Gardener, Trainer","inLanguage":"en-US","publisher":{"@id":"https:\/\/neependra.net\/#organization"}}]},"og:locale":"en_US","og:site_name":"Neependra Khare - Simplifier, Gardener, Trainer","og:type":"article","og:title":"How do log every thing printed on the terminal - Neependra Khare","og:description":"Sometimes we just keep working on a terminal and get lost what all we did.Isn't it good if we can get some kind of logs which can give us all steps we followed.First thing which comes in mind is the &quot;history&quot; command, but that will not give the standard outputs which we got after running","og:url":"https:\/\/neependra.net\/index.php\/2008\/09\/17\/how-do-log-every-thing-printed-on-the-terminal\/","article:published_time":"2008-09-17T00:29:00+00:00","article:modified_time":"2008-09-17T00:29:00+00:00","twitter:card":"summary_large_image","twitter:title":"How do log every thing printed on the terminal - Neependra Khare","twitter:description":"Sometimes we just keep working on a terminal and get lost what all we did.Isn't it good if we can get some kind of logs which can give us all steps we followed.First thing which comes in mind is the &quot;history&quot; command, but that will not give the standard outputs which we got after running"},"aioseo_meta_data":{"post_id":"78","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2023-12-28 12:09:21","updated":"2025-06-04 02:01:41","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/neependra.net\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/neependra.net\/index.php\/category\/uncategorized\/\" title=\"Uncategorized\">Uncategorized<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHow do log every thing printed on the terminal\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/neependra.net"},{"label":"Uncategorized","link":"https:\/\/neependra.net\/index.php\/category\/uncategorized\/"},{"label":"How do log every thing printed on the terminal","link":"https:\/\/neependra.net\/index.php\/2008\/09\/17\/how-do-log-every-thing-printed-on-the-terminal\/"}],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/neependra.net\/index.php\/wp-json\/wp\/v2\/posts\/78","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/neependra.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/neependra.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/neependra.net\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/neependra.net\/index.php\/wp-json\/wp\/v2\/comments?post=78"}],"version-history":[{"count":0,"href":"https:\/\/neependra.net\/index.php\/wp-json\/wp\/v2\/posts\/78\/revisions"}],"wp:attachment":[{"href":"https:\/\/neependra.net\/index.php\/wp-json\/wp\/v2\/media?parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/neependra.net\/index.php\/wp-json\/wp\/v2\/categories?post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/neependra.net\/index.php\/wp-json\/wp\/v2\/tags?post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}