mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Linux

Reply
 
Thread Tools
Old 2015-09-24, 12:42   #1
pepi37
 
pepi37's Avatar
 
Dec 2011
After milion nines:)

23×5×37 Posts
Default console output to txt file

I run mprime under console ( GUI -less) distro of Linux.
Then I stop mprime
How to save content of console ( and those lines which I cannot see) to text file.
I try this for last few hours and I cannot find answer
Once I found it and it was simple command, but now I cannot find it any more.
Any help?
Thanks
pepi37 is online now   Reply With Quote
Old 2015-09-24, 12:44   #2
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

22·1,607 Posts
Default

Quote:
Originally Posted by pepi37 View Post
I run mprime under console ( GUI -less) distro of Linux.
Then I stop mprime
How to save content of console ( and those lines which I cannot see) to text file.
I try this for last few hours and I cannot find answer
Once I found it and it was simple command, but now I cannot find it any more.
Any help?
Thanks
Try using ">" to redirect the output.
rogue is offline   Reply With Quote
Old 2015-09-24, 12:46   #3
pepi37
 
pepi37's Avatar
 
Dec 2011
After milion nines:)

23·5·37 Posts
Default

Quote:
Originally Posted by rogue View Post
Try using ">" to redirect the output.
give me 0 bytes txt file.
pepi37 is online now   Reply With Quote
Old 2015-09-24, 13:16   #4
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

61×163 Posts
Default

Quote:
Originally Posted by pepi37 View Post
give me 0 bytes txt file.
Try something like "mprime -d | tee mprime_log.txt".

This will write the output of mprime to STDOUT (read: the console) as well as the mprime_log.txt file.

Keep in mind that it is possible you saw the 0 bytes because of buffering; the "-d" debugging flag increases the output from mprime.
chalsall is online now   Reply With Quote
Old 2015-09-24, 13:21   #5
Xyzzy
 
Xyzzy's Avatar
 
Aug 2002

207516 Posts
Default

Code:
./mprime -d >> /path/to/file/filename &
Optionally, prepend "nohup" to the line to prevent the process from being killed if you close the terminal session.

You can view the file "in real time" with:

Code:
 tail -f /path/to/file/filename
Xyzzy is offline   Reply With Quote
Old 2015-09-24, 14:09   #6
pepi37
 
pepi37's Avatar
 
Dec 2011
After milion nines:)

23×5×37 Posts
Default

Quote:
Originally Posted by chalsall View Post
Try something like "mprime -d | tee mprime_log.txt".

This will write the output of mprime to STDOUT (read: the console) as well as the mprime_log.txt file.

Keep in mind that it is possible you saw the 0 bytes because of buffering; the "-d" debugging flag increases the output from mprime.
Why dont you first read my post before answer it.
Mprime has been stopped!
So I wont all text that mprime produced while it was working send to some file for reading.
pepi37 is online now   Reply With Quote
Old 2015-09-24, 20:02   #7
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3·29·83 Posts
Default

Quote:
Originally Posted by pepi37 View Post
Why dont you first read my post before answer it.
Mprime has been stopped!
So I wont all text that mprime produced while it was working send to some file for reading.
Notice how `mprime` is in the command he suggests?

Fundamentally, there is no way to get text from the terminal's stdout after the fact.

Re-read the above line, to be extra sure.

Now, having absorbed that, the question as you seem to demand it be answered, cannot be answered. Instead, you must specify in some way, when you *start* mprime, that you want to save the text. His suggestion is arguably the best way to do so.

Last fiddled with by Dubslow on 2015-09-24 at 20:03
Dubslow is offline   Reply With Quote
Old 2015-09-24, 21:06   #8
pepi37
 
pepi37's Avatar
 
Dec 2011
After milion nines:)

27108 Posts
Default

Quote:
Originally Posted by Dubslow View Post
Notice how `mprime` is in the command he suggests?

Fundamentally, there is no way to get text from the terminal's stdout after the fact.

Re-read the above line, to be extra sure.

Now, having absorbed that, the question as you seem to demand it be answered, cannot be answered. Instead, you must specify in some way, when you *start* mprime, that you want to save the text. His suggestion is arguably the best way to do so.
And I am sorry, but that is not true. As I say at my first post, I manage to do exactly what I need to do at same situation. And I will find way: if it was first time it will be on second also. It must be some kind of framebuffer where Linux as OS writes what is text in console.
Will find way..
Thanks for answers
pepi37 is online now   Reply With Quote
Old 2015-09-24, 21:37   #9
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

61×163 Posts
Default

Quote:
Originally Posted by pepi37 View Post
And I am sorry, but that is not true. As I say at my first post, I manage to do exactly what I need to do at same situation. And I will find way: if it was first time it will be on second also. It must be some kind of framebuffer where Linux as OS writes what is text in console.
Will find way..
Thanks for answers
As we say here in Bim, Cheese on Bread (young children say this so they aren't slapped for being blasphemous)!

If you happen to have a GUI shell showing STDOUT, you can copy-and-paste the output.

Only idiots rely on that.
chalsall is online now   Reply With Quote
Old 2015-09-24, 21:41   #10
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3×29×83 Posts
Default

There might be some OS-level tty logging somewhere... But I doubt it.
Dubslow is offline   Reply With Quote
Old 2015-09-24, 21:56   #11
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

20C016 Posts
Default

my two cents: http://stackoverflow.com/questions/3...-window-closes comes up when you google search console to text file after console closes ( no quotes) but it's about windows.
science_man_88 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows concurrent output to the screen and a file. petrw1 Homework Help 14 2018-04-26 22:45
Additional File Output for Visualization Project conere10 Software 7 2011-10-15 23:05
prp output file jasong Sierpinski/Riesel Base 5 1 2005-03-13 05:41
Iterations between results file output? edorajh Software 8 2003-11-20 02:28
Small windows programs to create and delete the stop.txt file for console ver NFSNET dsouza123 Programming 0 2003-09-28 20:40

All times are UTC. The time now is 22:27.


Mon Oct 18 22:27:26 UTC 2021 up 87 days, 16:56, 0 users, load averages: 1.22, 1.23, 1.26

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.