Find the answer to your Linux question:
Results 1 to 3 of 3
Hi this is my first post here and I'm just finding my feet. I have etch from net install a couple of days ago and I am running with only ...
  1. #1
    Just Joined! cosine.au's Avatar
    Join Date
    Mar 2007
    Location
    Western Australia
    Posts
    3

    how do I output the result of a command to a vi file?

    Hi this is my first post here and I'm just finding my feet. I have etch from net install a couple of days ago and I am running with only a few packages which I selected manually after bare bones install.

    ie. fluxbox and Iceweasel and tvtime

    I am troubleshooting tvtime but want to upload the output I see in the command line so I can show it to others.

    is there something to append after the command to create a new text file?

    Also a related question - is there a package required to take a screenshot?

    Cheers

  2. #2
    Linux Engineer Zelmo's Avatar
    Join Date
    Jan 2006
    Location
    Riverton, UT, USA
    Posts
    1,001
    For tvtime you have a few options. The easiest is to have a graphical text editor ready (i.e., gedit if you're using Gnome, or kedit/kwrite/kate if you're using KDE), then highlight whatever text you want from the terminal, and middle-click into the text editor. It will paste the selected text in.

    A more automatic way to do it that doesn't require a graphical text editor is to redirect the output to a file. You can do this in a couple of ways. The first way is a straight redirect:
    Code:
    tvtime 1> tvtime_output 2>&1
    This assumes the binary is called 'tvtime'. The "1>" part tells the shell to redirect stdout to the specified file ('tvtime_output' in this case). The "2>&1" bit tells the shell to redirect stderr to the same file as stdout. This way, all the messages that tvtime would normally print to the terminal get put in the tvtime_output file.

    A similar but handier method is to pipe tvtime through tee:
    Code:
    tvtime | tee tvtime_output
    Tee will take the output from tvtime and put it in the specified file (again, "tvtime_output" in our example) as well as printing it to the terminal. So you can see what's going into the file as it happens.

    As for the screenshot program, you can install ksnapshot. If you're using Gnome, I think there's a screenshot program built in, but I don't know what it is. Maybe someone else can help out there. Of course, you can still install ksnapshot regardless of what GUI you're using, but it may install several QT and/or KDE packages as dependencies.
    Stand up and be counted as a Linux user!

  3. #3
    Just Joined! cosine.au's Avatar
    Join Date
    Mar 2007
    Location
    Western Australia
    Posts
    3
    Thanks alot for those tips Zelmo,

    I'm still having trouble with the graphics card not having the correct device settings in /etc/X11/xorg.conf for the tvcard functionality but am going to come back to it later when I have more confidence.

    be well

Posting Permissions

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