Results 1 to 2 of 2

Thread: Managing bash console log

  1. #1

    Default Managing bash console log

    Not sure if "bash console log" is the correct name. What I need is to keep, and retrieve later, all the messages produced by the work I have done through a bash terminal, so I can review it and build documentation. This is not only the "history" bash file with the commands I've entered, it also should include the system responses. I've looking for how to do it using Google, but I can't find even one mention of this ... surely because I am not using the correct log name. Most of the people ask questions about error logs, journals, audit logs, etc .. what I need is to locate "the-work-my-user-have-done" log and learn how to manage it... I will appreciate any help about this.

    Cheers
    Andres

  2. #2
    Join Date
    May 2012
    Location
    Finland
    Posts
    2,004

    Default Re: Managing bash console log

    I'm not sure if this is what you're after, but there is a command called script which logs everything you type into the terminal and all the output from all commands.

    For example;
    script my_cool_log.txt

    Then whatever you type and whatever you get from responses from there on out will be logged into my_cool_log.txt and when you type exit from the shell, it will end logging.

    An example;
    Code:
    backup:~ # script woot.txt
    Script started, file is woot.txt
    [BACKUP] backup:~ # ping www.opensuse.org
    PING www.opensuse.org (130.57.66.6) 56(84) bytes of data.
    64 bytes from 130.57.66.6 (130.57.66.6): icmp_seq=1 ttl=43 time=178 ms
    64 bytes from 130.57.66.6 (130.57.66.6): icmp_seq=2 ttl=43 time=178 ms
    64 bytes from 130.57.66.6 (130.57.66.6): icmp_seq=3 ttl=43 time=178 ms
    ^C
    --- www.opensuse.org ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 2000ms
    rtt min/avg/max/mdev = 178.084/178.129/178.208/0.056 ms
    [BACKUP] backup:~ # exit
    exit
    Script done, file is woot.txt
    
    
    
    backup:~ # cat woot.txt
    Script started on 2017-08-08 13:53:32+0300
    [BACKUP] backup:~ # ping www.opensuse.org
    PING www.opensuse.org (130.57.66.6) 56(84) bytes of data.
    64 bytes from 130.57.66.6 (130.57.66.6): icmp_seq=1 ttl=43 time=178 ms
    64 bytes from 130.57.66.6 (130.57.66.6): icmp_seq=2 ttl=43 time=178 ms
    64 bytes from 130.57.66.6 (130.57.66.6): icmp_seq=3 ttl=43 time=178 ms
    ^C
    --- www.opensuse.org ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 2000ms
    rtt min/avg/max/mdev = 178.084/178.129/178.208/0.056 ms
    [BACKUP] backup:~ # exit
    exit
    
    
    Script done on 2017-08-08 13:53:42+0300
    .: miuku #suse @ irc.freenode.net
    :: miuku@opensuse.org

    .: h​ttps://download.opensuse.org/repositories/home:/Miuku/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •