How to see and save update output?

How to complete the output at the time of the update and save it in a file?

sudo pacman -Syu
1 Like

Hi @Usr2023,

You can use the tee command for that.

But, I’ve written a script that does exactly what you want, and more. See:

3 Likes

script

man script
for the options it provides

It starts a session and everything and every command output
and everything you type as well
including passwords(!)
until you end it is recorded as you see it and type it

start script
then run your command
then end script

3 Likes

My script at least removes the passwords…

1 Like

It has been some time since I used it - and I’m not on Manjaro but Mint.
Perhaps there is a difference in default behavior.
I know that they where in there …
I mentioned it in case they wanted to publicly share the output.

1 Like

Yeah, good thinking and I just thought I’d mention it too.

:wave:

I’ve done a test and if we type script after a started script session it will “restart” another script session appended to the first script session saving it to the first file session and also part of it on a new file from the second session. It looks like to screencast a running screencast in a VM, or mirrors facing each other. So to end a script session, type exit.

Running a basic script with -B followed by a file name, it will save everything (including password) input, output, even results of arrow keys (up and down), into that filename. But there are others flags to play with. We could just run script without naming it and it will create a file called “typescript”.

I didn’t know about this script command and I like it, but reading its man, --help infos, we don’t have a flag that hide sensitive information, or to auto end it after a completed update, so the Mirdarthos’ script "mumuh"could solve theses problems. I will going to test it.

:vulcan_salute:

1 Like

Another method is to simply run:

sudo pacman -Syu > NameThisFile.txt

while in your /home/<username> directory.

All output will be printed to ~/NameThisFile.txt


I’ll add that using a single > in that command (again) will overwrite that file, unless you use a different filename.

To avoid littering your /home with many text files, one can also append to the same filename using >> instead.

For example:

sudo pacman -Syu > NameThisFile.txt
pamac update --aur >> NameThisFile.txt
flatpak update >> NameThisFile.txt
1 Like

Konsole… Try this:

ls

Now save with CtrlShiftS - I just saved to ~/Desktop/konsole.txt and opened it with helix.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.