Author Topic: How To Save Text In Console Display To Text File?  (Read 4419 times)

ArchiMark

  • Administrator
  • Hero Member
  • *****
  • Posts: 1830
    • View Profile
How To Save Text In Console Display To Text File?
« on: April 11, 2006, 10:46:54 am »
Forgot how to do this....hope someone can please advise....

When you're working in Terminal or Konsole, how can you save out what is shown on the display to a text file somewhere?

I am NOT talking about viewing a text file and saving it.

I am referring to the text that is shown on the display while you're working in Terminal such as executing a command and watching the progress of it, like installing a program.

I assume that it is something like:

[CODE]
$  xxxxxxx   >  "file location/filename.txt"

It is the part on the left side of the ' > ' that I'm wondering about....

Unless there is another way to do this....

Thanks!

Mark
Silicon Valley Digerati - * Please see my Mini Laptops For Sale Listing *
Cosmo Communicator / One-Netbook One Mix Yoga 3S (Win 10/Manjaro 18)
Banana Pi Zero UMPC/Armbian
MacBookPro
Sold: C3200/N900/OQO/N5/Dell Mini9/Netwalker/UMID M1/

grog

  • Hero Member
  • *****
  • Posts: 692
    • View Profile
    • http://
How To Save Text In Console Display To Text File?
« Reply #1 on: April 11, 2006, 10:51:58 am »
There are serveral different ways (of course, this in UNIX-like after all, there's always more than one way to cat a skin ).

This will save all output from command into file.out, including any error messages.
Code: [Select]
command > file.out 2>&1
This will save all output from command into file.out, as well as showing it on the screen at the same time.
Code: [Select]
command 2>&1 | tee file.out
HTH
GROG!

DaemonsGR

  • Full Member
  • ***
  • Posts: 237
    • View Profile
How To Save Text In Console Display To Text File?
« Reply #2 on: April 11, 2006, 10:53:15 am »
For example!

echo "Test" > /home/user/test.text
or
ps aux|grep aterm > /home/user/aterm.ps
or
ls -la > /home....

or if you need only errors you can do
ipkg install lala.ipk 2> install.error

did it help?


EDIT: HTH's is better
« Last Edit: April 11, 2006, 10:54:56 am by DaemonsGR »
Tasos Varoudis (Tech)
Tasos Varoudis (Architecture)

Zaurus sl-c3100 + Wlan, Lan ,BT ,etc
NOW running... pdaXrom 1.1.0beta3 + OOo + custom apps/setup + debian +.. not yet installed OpenBSD snapshot

WAS:Cacko 1.23 + X/QT + debian

Home-Net
Debian WIFI Router ,OpenBSD Bridge Firewall ,Win 2k Domain Server , :) Sun Fire v120 , :) Gentoo Main Server: Dual PIII

ArchiMark

  • Administrator
  • Hero Member
  • *****
  • Posts: 1830
    • View Profile
How To Save Text In Console Display To Text File?
« Reply #3 on: April 11, 2006, 11:02:04 am »
Thanks, grog and DaemonsGR....but not sure either of you still get what I'm trying to do.... although maybe I am wrong...  

I have already run the command and so now have lots of text shown on the display.

How do I save that text to a file?

In other words, is it possible to save what I see on the screen after I have run a command, not during the running of the command???

Thanks,

Mark
Silicon Valley Digerati - * Please see my Mini Laptops For Sale Listing *
Cosmo Communicator / One-Netbook One Mix Yoga 3S (Win 10/Manjaro 18)
Banana Pi Zero UMPC/Armbian
MacBookPro
Sold: C3200/N900/OQO/N5/Dell Mini9/Netwalker/UMID M1/

bluedevils

  • Hero Member
  • *****
  • Posts: 1284
    • View Profile
    • http://
How To Save Text In Console Display To Text File?
« Reply #4 on: April 11, 2006, 11:23:52 am »
wouldn't that just be cut and paste?

Highlight the text, open text editor and hit the paste button.
I'm now an iphone user and use my zaurii as serial terminals, perl and shell scripting and when I need 640x480 screens

sl-c3100/pda cacko 1.23 | sl-6000l/needs battery | sl-c760/server pdaxrom rc12 | Former sl-5500/tkcrom owner (sister's birthday gift)

ArchiMark

  • Administrator
  • Hero Member
  • *****
  • Posts: 1830
    • View Profile
How To Save Text In Console Display To Text File?
« Reply #5 on: April 11, 2006, 11:49:31 am »
Bingo!!!

Thanks, bluedevils!!

Now why didn't I think of that.....  

 

Mark

Quote
wouldn't that just be cut and paste?

Highlight the text, open text editor and hit the paste button.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=122667\"][{POST_SNAPBACK}][/a][/div]
Silicon Valley Digerati - * Please see my Mini Laptops For Sale Listing *
Cosmo Communicator / One-Netbook One Mix Yoga 3S (Win 10/Manjaro 18)
Banana Pi Zero UMPC/Armbian
MacBookPro
Sold: C3200/N900/OQO/N5/Dell Mini9/Netwalker/UMID M1/

bluedevils

  • Hero Member
  • *****
  • Posts: 1284
    • View Profile
    • http://
How To Save Text In Console Display To Text File?
« Reply #6 on: April 11, 2006, 12:22:48 pm »
From your original post, I would have given grog's answer, but your followup cleared things up.
I'm now an iphone user and use my zaurii as serial terminals, perl and shell scripting and when I need 640x480 screens

sl-c3100/pda cacko 1.23 | sl-6000l/needs battery | sl-c760/server pdaxrom rc12 | Former sl-5500/tkcrom owner (sister's birthday gift)

Ragnorok

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
    • http://
How To Save Text In Console Display To Text File?
« Reply #7 on: April 11, 2006, 12:46:30 pm »
- It's the simple things that are always the hardest.  (befuddled grin)
| I shed a tear for the passing of Hiroshi; he served me well
| Zaurus zealot since Nov 2002, PDA user since Oct 1991
| Replaced Z with UMID BZ February 2010

Jon_J

  • Hero Member
  • *****
  • Posts: 1853
    • View Profile
    • http://
How To Save Text In Console Display To Text File?
« Reply #8 on: April 11, 2006, 12:53:11 pm »
I always just do this in console. My example is for "df -h" (dmseg and other output commands also write to a text file)
-------------------------
df -h > /hdd3/dfh.txt
-------------------------
Then I just attach my Z to my winxp box and copy the file over.
In winxp, you'll need to open it in wordpad to format it correctly.
If you have Cacko Lite 1.23 installed you'll need the following lib installed,
otherwise copy/paste doesn't format correctly, and above command results in a zero byte, empty file.
unicon-modules-2.4.20_1.23-lite-1_arm.ipk
C3100 Multiboot-->Angstrom 2007.12-r18 | Cacko 1.23 | ArchLinuxARM
C3200 pdaxii13v2-5.5-alpha4 Akita on NAND

Ambicom WL1100C-CF Wifi - Ambicom CF modem - Ambicom CF GPS - Belkin-F5D5050 USB LAN
Socket CF Bluetooth rev K - Iogear 4 port USB micro hub - pocket CF card reader
Targus mini USB optical mouse - 2 Targus SD card readers

ArchiMark

  • Administrator
  • Hero Member
  • *****
  • Posts: 1830
    • View Profile
How To Save Text In Console Display To Text File?
« Reply #9 on: April 11, 2006, 01:58:54 pm »
Amen, brother Ragnorok !!!

 

Mark

Quote
- It's the simple things that are always the hardest.  (befuddled grin)
[div align=\"right\"][a href=\"index.php?act=findpost&pid=122678\"][{POST_SNAPBACK}][/a][/div]
Silicon Valley Digerati - * Please see my Mini Laptops For Sale Listing *
Cosmo Communicator / One-Netbook One Mix Yoga 3S (Win 10/Manjaro 18)
Banana Pi Zero UMPC/Armbian
MacBookPro
Sold: C3200/N900/OQO/N5/Dell Mini9/Netwalker/UMID M1/

ArchiMark

  • Administrator
  • Hero Member
  • *****
  • Posts: 1830
    • View Profile
How To Save Text In Console Display To Text File?
« Reply #10 on: April 11, 2006, 01:59:47 pm »
Thanks for your tip, Jon_J !!

Mark
Silicon Valley Digerati - * Please see my Mini Laptops For Sale Listing *
Cosmo Communicator / One-Netbook One Mix Yoga 3S (Win 10/Manjaro 18)
Banana Pi Zero UMPC/Armbian
MacBookPro
Sold: C3200/N900/OQO/N5/Dell Mini9/Netwalker/UMID M1/

Da_Blitz

  • Hero Member
  • *****
  • Posts: 1579
    • View Profile
    • http://www.pocketnix.org
How To Save Text In Console Display To Text File?
« Reply #11 on: April 13, 2006, 08:55:00 am »
Cool trick with 2.6 (and mabey 2.4) with frame buffers
Code: [Select]
cat /dev/fb0 > $HOME/screen.pictakes a screen shot and works even on the command line without X11

doing the reverse:
Code: [Select]
cat $HOME/screen.pic > /dev/fb0allows you to see the image, handy for something but normally a file descripter redirection works better (ie using >) but if you want to take a pic of a ncurses app its a great tool, just team it up with sleep
Code: [Select]
sleep 3; cat /dev/fb0 > $HOME/screen.picthis takes a screenshot after 3 seconds, allowing you to switch VT's or bring up another console
Personal Blog
Code
Twitter

Gemini Order: #95 (roughly)
Current Device: Samsung Chromebook Gen 3
Current Arm Devices Count: ~30
Looking to acquire: Cavium Thunder X2 Hardware

jako

  • Newbie
  • *
  • Posts: 2
    • View Profile
How To Save Text In Console Display To Text File?
« Reply #12 on: December 26, 2006, 06:01:02 am »
[/code]
this takes a screenshot after 3 seconds, allowing you to switch VT's or bring up another console
[div align=\"right\"][a href=\"index.php?act=findpost&pid=123003\"][{POST_SNAPBACK}][/a][/div]
[/quote]

Hello,
I'm trying to use OZ bootstrapp distro. Could you please tell me how to open more VT's and how to switch from one to another.
thanks for help

Da_Blitz

  • Hero Member
  • *****
  • Posts: 1579
    • View Profile
    • http://www.pocketnix.org
How To Save Text In Console Display To Text File?
« Reply #13 on: December 27, 2006, 12:51:09 am »
you have to edit the /etc/inittab file to launch more getty's on other tty's, just copy and paste the getty entries and change the first field (must be unique) and the tty device

i have 5 and also changed the keyboard button bindings so that the row of keys on the bottom left switches between the VT's
Personal Blog
Code
Twitter

Gemini Order: #95 (roughly)
Current Device: Samsung Chromebook Gen 3
Current Arm Devices Count: ~30
Looking to acquire: Cavium Thunder X2 Hardware