unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* how can I find the terminal output
@ 2022-04-15 20:15 Gottfried
  2022-04-30  9:06 ` zimoun
  0 siblings, 1 reply; 9+ messages in thread
From: Gottfried @ 2022-04-15 20:15 UTC (permalink / raw)
  To: help-guix

I entered "guix shell" in the terminal,
and it created an empty environment.

How can I find now the terminal output in order to find the empty 
environment and to delete it?

What are the general terminal commands in order to read the history of 
the outputs?

thanks in advance

Gottfried


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how can I find the terminal output
  2022-04-15 20:15 how can I find the terminal output Gottfried
@ 2022-04-30  9:06 ` zimoun
  2022-04-30 18:07   ` Gottfried
  0 siblings, 1 reply; 9+ messages in thread
From: zimoun @ 2022-04-30  9:06 UTC (permalink / raw)
  To: Gottfried, help-guix

Hi,

On Fri, 15 Apr 2022 at 20:15, Gottfried <gottfried@posteo.de> wrote:
> I entered "guix shell" in the terminal,
> and it created an empty environment.

Empty environment means that nothing had been added, i.e., you have what
is defined by the current PATH from where you call “guix shell”.


> How can I find now the terminal output in order to find the empty 
> environment and to delete it?

I do not understand what you mean here.  Once in the environment “guix
shell”, just type exit to return to the original environment.

All the extra files required to create the environment are still in the
store, so if you run again “guix shell”, then the creation of the
environment will be really quick.

Note that if you run “guix pull” between two “guix shell”, you have no
guarantee that the same shell will be created.

At the next garbage collection (for instance, guix gc -F 5G), all these
extra files will be removed from your store, possibly.


> What are the general terminal commands in order to read the history of 
> the outputs?

It depends on your shell.  I guess you are using the default shell –
which should be bash – from your Linux distro.  Therefore, all the
history is in ~/.bash_history.

Well, I do not know how Bash manages the history of concurrent
sessions.  Other said, if you have 2 terminals open, i.e., two Bash
sessions, which is the session recorded?  But that’s unrelated to “guix
shell”. ;-)


Hope that helps,
simon


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how can I find the terminal output
  2022-04-30  9:06 ` zimoun
@ 2022-04-30 18:07   ` Gottfried
  2022-05-02  8:54     ` zimoun
  0 siblings, 1 reply; 9+ messages in thread
From: Gottfried @ 2022-04-30 18:07 UTC (permalink / raw)
  To: zimoun, help-guix

Hi,
thanks for your answer,

>  I entered "guix shell" in the terminal,
>>> and it created an empty environment.

I meant without any option, (just "guix shell") therefore it created an 
empty environment.
(I didn't know what the guix shell is for. I just read the manual and 
understood the purpose of guix shell).


> How can I find now the terminal output in order to find the empty
>>> environment and to delete it?
>> 
>> I do not understand what you mean here.  Once in the environment “guix >> shell”, just type exit to return to the original environment.


Because I don't know how it works, I guessed that the "empty 
environment" is a new created file which has been added and I wanted to 
get rid of this file.

 >> What are the general terminal commands in order to read the history 
of >> the outputs?
 >
 > It depends on your shell.  I guess you are using the default shell –
 > which should be bash – from your Linux distro.  Therefore, all the
 > history is in ~/.bash_history.

I am using the Bash terminal, Mate terminal in my case.

Opening the  ~/.bash_history
tells me only my inputs, my commands, but it does not show what was the 
output of my commands. Where I can find those in my Bash shell?

hope that makes my questions as a newcommer clear
Gottfried


Am 30.04.22 um 11:06 schrieb zimoun:
> Hi,
> 
> On Fri, 15 Apr 2022 at 20:15, Gottfried <gottfried@posteo.de> wrote:
>> I entered "guix shell" in the terminal,
>> and it created an empty environment.
> 
> Empty environment means that nothing had been added, i.e., you have what
> is defined by the current PATH from where you call “guix shell”.
> 
> 
>> How can I find now the terminal output in order to find the empty
>> environment and to delete it?
> 
> I do not understand what you mean here.  Once in the environment “guix
> shell”, just type exit to return to the original environment.
> 
> All the extra files required to create the environment are still in the
> store, so if you run again “guix shell”, then the creation of the
> environment will be really quick.
> 
> Note that if you run “guix pull” between two “guix shell”, you have no
> guarantee that the same shell will be created.
> 
> At the next garbage collection (for instance, guix gc -F 5G), all these
> extra files will be removed from your store, possibly.
> 
> 
>> What are the general terminal commands in order to read the history of
>> the outputs?
> 
> It depends on your shell.  I guess you are using the default shell –
> which should be bash – from your Linux distro.  Therefore, all the
> history is in ~/.bash_history.
> 
> Well, I do not know how Bash manages the history of concurrent
> sessions.  Other said, if you have 2 terminals open, i.e., two Bash
> sessions, which is the session recorded?  But that’s unrelated to “guix
> shell”. ;-)
> 
> 
> Hope that helps,
> simon




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how can I find the terminal output
  2022-04-30 18:07   ` Gottfried
@ 2022-05-02  8:54     ` zimoun
  2022-05-02 12:53       ` Tobias Geerinckx-Rice
  0 siblings, 1 reply; 9+ messages in thread
From: zimoun @ 2022-05-02  8:54 UTC (permalink / raw)
  To: Gottfried, help-guix

Hi,

On Sat, 30 Apr 2022 at 18:07, Gottfried <gottfried@posteo.de> wrote:

> Because I don't know how it works, I guessed that the "empty 
> environment" is a new created file which has been added and I wanted to 
> get rid of this file.

The “empty environment” means an “empty profile”, so it is managed by
Guix and its garbage collection.  Therefore, you do not have to worry
about it.


> Opening the  ~/.bash_history
> tells me only my inputs, my commands, but it does not show what was the 
> output of my commands. Where I can find those in my Bash shell?

Bash does not record the output of each command.  You have to
specifically tell what you want; by redirecting the outputs.  Give a
look at the manual. :-)

<https://www.gnu.org/software/bash/manual/html_node/Redirections.html>


Cheers,
simon


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how can I find the terminal output
  2022-05-02  8:54     ` zimoun
@ 2022-05-02 12:53       ` Tobias Geerinckx-Rice
  2022-05-06 20:18         ` Gottfried
  0 siblings, 1 reply; 9+ messages in thread
From: Tobias Geerinckx-Rice @ 2022-05-02 12:53 UTC (permalink / raw)
  To: help-guix, Gottfried

Gottfried,

script(1) is the classic way to log your shell (or any) session to a text file.

See <https://www.man7.org/linux/man-pages/man1/script.1.html>.

There's more fancy stuff like asciinema but that seems like overkill here.

Kind regards,

T G-R

Sent on the go.  Excuse or enjoy my brevity.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how can I find the terminal output
  2022-05-02 12:53       ` Tobias Geerinckx-Rice
@ 2022-05-06 20:18         ` Gottfried
  2022-05-07 15:42           ` zimoun
  0 siblings, 1 reply; 9+ messages in thread
From: Gottfried @ 2022-05-06 20:18 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice, help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 943 bytes --]

Hello,
Don't mind if I am asking simple questions because I have to learn the 
basics.

How do I have to use "script"?
Do I have to enter "script" in the terminal before I start other 
commands, so that it will start to log my shell?
or can I, after a command with output, enter "script" and it will log my 
output in a file typescript?

I tried several times, but it didn't work. It didn't record anything, 
when I opened the file typescript.

So can you show me an example how to use it?
What Options are useful?

Gottfried



Am 02.05.22 um 14:53 schrieb Tobias Geerinckx-Rice:
> Gottfried,
> 
> script(1) is the classic way to log your shell (or any) session to a text file.
> 
> See <https://www.man7.org/linux/man-pages/man1/script.1.html>.
> 
> There's more fancy stuff like asciinema but that seems like overkill here.
> 
> Kind regards,
> 
> T G-R
> 
> Sent on the go.  Excuse or enjoy my brevity.


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how can I find the terminal output
  2022-05-06 20:18         ` Gottfried
@ 2022-05-07 15:42           ` zimoun
  2022-05-09 11:42             ` Kyle
  0 siblings, 1 reply; 9+ messages in thread
From: zimoun @ 2022-05-07 15:42 UTC (permalink / raw)
  To: Gottfried, Tobias Geerinckx-Rice, help-guix

Hi,

On Fri, 06 May 2022 at 20:18, Gottfried <gottfried@posteo.de> wrote:

> How do I have to use "script"?

Only you can answer. ;-)  The question is: what is your needs?  Do you
need to record and track the output for each command?

Personally, I only do that for the very rare cases when I am demoing.
Otherwise, I only redirect the output of a command to a file using ’>’.


> Do I have to enter "script" in the terminal before I start other 
> commands, so that it will start to log my shell?

Yes.

> or can I, after a command with output, enter "script" and it will log my 
> output in a file typescript?

No.

However, you can redo the same command to append the output to a
previous ’typescript’.  For instance, in your terminal:

        ls
        script
        ls
        exit
        pwd
        script -a
        cd /tmp/
        ls
        pwd
        exit

Then the file ’typescript’ contains the session (input and output)
between ’script’ and ’exit’ (included).  Therefore, the first ’pwd’ will
be not recorded.



> I tried several times, but it didn't work. It didn't record anything, 
> when I opened the file typescript.
>
> So can you show me an example how to use it?
> What Options are useful?

Well, have you read the manpage of ’script’?  Type ’man script’.


Hope that helps,
simon


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how can I find the terminal output
  2022-05-07 15:42           ` zimoun
@ 2022-05-09 11:42             ` Kyle
  2022-05-09 16:21               ` Gottfried
  0 siblings, 1 reply; 9+ messages in thread
From: Kyle @ 2022-05-09 11:42 UTC (permalink / raw)
  To: help-guix, zimoun, Gottfried

I have never used the command script, but I thought you might benefit from installing the tldr utility: whose name is short for "too long didn't read" It gives examples instead of all the unwanted details that man pages throw at you first even though they don't make a lick of sense without the right background knowledge and perspective. There are many implementations, but I like tealdeer.

  guix install tealdeer

Then type:

  tldr script

That produces a few examples for me.


On May 7, 2022 11:42:28 AM EDT, zimoun <zimon.toutoune@gmail.com> wrote:
>Hi,
>
>On Fri, 06 May 2022 at 20:18, Gottfried <gottfried@posteo.de> wrote:
>
>> How do I have to use "script"?
>
>Only you can answer. ;-)  The question is: what is your needs?  Do you
>need to record and track the output for each command?
>
>Personally, I only do that for the very rare cases when I am demoing.
>Otherwise, I only redirect the output of a command to a file using ’>’.
>
>
>> Do I have to enter "script" in the terminal before I start other 
>> commands, so that it will start to log my shell?
>
>Yes.
>
>> or can I, after a command with output, enter "script" and it will log my 
>> output in a file typescript?
>
>No.
>
>However, you can redo the same command to append the output to a
>previous ’typescript’.  For instance, in your terminal:
>
>        ls
>        script
>        ls
>        exit
>        pwd
>        script -a
>        cd /tmp/
>        ls
>        pwd
>        exit
>
>Then the file ’typescript’ contains the session (input and output)
>between ’script’ and ’exit’ (included).  Therefore, the first ’pwd’ will
>be not recorded.
>
>
>
>> I tried several times, but it didn't work. It didn't record anything, 
>> when I opened the file typescript.
>>
>> So can you show me an example how to use it?
>> What Options are useful?
>
>Well, have you read the manpage of ’script’?  Type ’man script’.
>
>
>Hope that helps,
>simon
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how can I find the terminal output
  2022-05-09 11:42             ` Kyle
@ 2022-05-09 16:21               ` Gottfried
  0 siblings, 0 replies; 9+ messages in thread
From: Gottfried @ 2022-05-09 16:21 UTC (permalink / raw)
  To: Kyle, help-guix, zimoun


[-- Attachment #1.1.1: Type: text/plain, Size: 2986 bytes --]

Dear Guixers,

thank you very much for your patience and infos, Simon and Kyle,

now I understand how script works and I can use it.
Thanks also for mentioning tealdeer.That's great, exactly what I need, 
examples of usage.

I still have trouble to understand the man pages. I am not a hacker or 
programmer and am not using the commandline on a daily basis. So I am 
still "hacking" on the basis. I am not used to understanding the 
programmers language yet. I am learning day by day.

Gottfried


Am 09.05.22 um 13:42 schrieb Kyle:
> I have never used the command script, but I thought you might benefit from installing the tldr utility: whose name is short for "too long didn't read" It gives examples instead of all the unwanted details that man pages throw at you first even though they don't make a lick of sense without the right background knowledge and perspective. There are many implementations, but I like tealdeer.
> 
>    guix install tealdeer
> 
> Then type:
> 
>    tldr script
> 
> That produces a few examples for me.
> 
> 
> On May 7, 2022 11:42:28 AM EDT, zimoun <zimon.toutoune@gmail.com> wrote:
>> Hi,
>>
>> On Fri, 06 May 2022 at 20:18, Gottfried <gottfried@posteo.de> wrote:
>>
>>> How do I have to use "script"?
>>
>> Only you can answer. ;-)  The question is: what is your needs?  Do you
>> need to record and track the output for each command?
>>
>> Personally, I only do that for the very rare cases when I am demoing.
>> Otherwise, I only redirect the output of a command to a file using ’>’.
>>
>>
>>> Do I have to enter "script" in the terminal before I start other
>>> commands, so that it will start to log my shell?
>>
>> Yes.
>>
>>> or can I, after a command with output, enter "script" and it will log my
>>> output in a file typescript?
>>
>> No.
>>
>> However, you can redo the same command to append the output to a
>> previous ’typescript’.  For instance, in your terminal:
>>
>>         ls
>>         script
>>         ls
>>         exit
>>         pwd
>>         script -a
>>         cd /tmp/
>>         ls
>>         pwd
>>         exit
>>
>> Then the file ’typescript’ contains the session (input and output)
>> between ’script’ and ’exit’ (included).  Therefore, the first ’pwd’ will
>> be not recorded.
>>
>>
>>
>>> I tried several times, but it didn't work. It didn't record anything,
>>> when I opened the file typescript.
>>>
>>> So can you show me an example how to use it?
>>> What Options are useful?
>>
>> Well, have you read the manpage of ’script’?  Type ’man script’.
>>
>>
>> Hope that helps,
>> simon
>>
> 


-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

Why is HTML email a security nightmare? See https://useplaintext.email/

Please avoid sending me MS-Office attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-05-09 16:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-15 20:15 how can I find the terminal output Gottfried
2022-04-30  9:06 ` zimoun
2022-04-30 18:07   ` Gottfried
2022-05-02  8:54     ` zimoun
2022-05-02 12:53       ` Tobias Geerinckx-Rice
2022-05-06 20:18         ` Gottfried
2022-05-07 15:42           ` zimoun
2022-05-09 11:42             ` Kyle
2022-05-09 16:21               ` Gottfried

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).