LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-17-2002, 03:49 PM   #1
joadoor
Member
 
Registered: Apr 2002
Location: Clevedon, UK
Distribution: SUSE 8.2, 9.2, 10.0 OSS
Posts: 57

Rep: Reputation: 15
Piping output to a text file


Me again ...

How can I pipe an output of a command to a txt file? In Dos you'd use the > option, eg. dir /s > file.txt

TIA
Joadoor
 
Old 04-17-2002, 03:53 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
same way in linux.. example:

ls -al /etc > etc.txt

and if you wanted to add to the existing file etc.txt:

ls -al /etc/inittab >> etc.txt
 
Old 04-17-2002, 04:04 PM   #3
joadoor
Member
 
Registered: Apr 2002
Location: Clevedon, UK
Distribution: SUSE 8.2, 9.2, 10.0 OSS
Posts: 57

Original Poster
Rep: Reputation: 15
oh ... I tried that and it didn't work. hum..

I think I was trying to install (rpm) a nvidia driver but it was giving me errors, so I was going to pipe the error message output to a file (so I could post it here ) but it just created an empty file. Can the > only be used in certain circumstances??

btw, I have had a browse around and found a few fixes that might help me with the nvidia problem; i'm going to try 'make'ing my own !!
 
Old 04-17-2002, 04:17 PM   #4
dorward
Member
 
Registered: Sep 2001
Distribution: Gentoo
Posts: 760

Rep: Reputation: 31
> only pipes STDOUT, errors are usully on STDERR try:

Code:
myCommand > myCommand.out 2> myCommand.errors
 
Old 04-18-2002, 04:08 AM   #5
joadoor
Member
 
Registered: Apr 2002
Location: Clevedon, UK
Distribution: SUSE 8.2, 9.2, 10.0 OSS
Posts: 57

Original Poster
Rep: Reputation: 15
huh ??
STDOUT, STDERR what are they?

The nvidia command I think I used was

modprobe nvidia

so would I use

modeprobe nvidia > myoutput.out 2> myoutput.errors
 
Old 04-18-2002, 05:32 AM   #6
5amYan
Member
 
Registered: Apr 2002
Location: The District
Distribution: FreeBSD, OBSD maybe Gentoo and Winblech XP
Posts: 291

Rep: Reputation: 30
yes to above

or if you want to add it to the end of a file use >>

Last edited by 5amYan; 04-18-2002 at 05:34 AM.
 
Old 04-18-2002, 09:42 AM   #7
dorward
Member
 
Registered: Sep 2001
Distribution: Gentoo
Posts: 760

Rep: Reputation: 31
Quote:
Originally posted by joadoor
huh ??
STDOUT, STDERR what are they?
Standard Output and Standard (Output for) Error (Messages)

Both are usually directed to the screen.
 
Old 04-19-2002, 04:50 AM   #8
joadoor
Member
 
Registered: Apr 2002
Location: Clevedon, UK
Distribution: SUSE 8.2, 9.2, 10.0 OSS
Posts: 57

Original Poster
Rep: Reputation: 15
I have just tried updating my nvidia drivers from scratch ie compiling them, then 'make install' ing them, but ended up with the following error message:

----------------------------------------------------------------------------
You appear to be compiling the NVdriver kernel module with
a compiler different from the one that was used to compile
the running kernel. This may be perfectly fine, but there
are cases where this can lead to unexpected behaviour and
system crashes.
If you know what you are doing and want to override this
check, you can do so by setting IGNORE_CC_MISMATCH.
In any other case, set the CC environment variable to the
name of the compiler that was used to compile the kernel.

Failed cc sanity check. Bailing out!
-----------------------------------------------------------------------------

I un-tar'd them, then did 'make install' on the GLX drivers first (although the instructions said to do the kernel first .. oops, does this make a difference; if so, is there a way I can fix it)

at the moment I can't get into X - never mind, I quite like the command prompt
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pipe output to append to a text file davee Linux - Newbie 5 03-22-2016 08:44 PM
Piping output to text files corbis_demon Linux - General 3 10-12-2004 04:33 AM
how to enumerate first line of text file to standard output? zero79 Linux - General 1 07-07-2004 07:37 PM
Pipe telnet session output to text file joshlamerritt Linux - Software 3 02-10-2004 09:42 PM
Piping file list through rm swingheim Linux - Newbie 4 01-17-2004 06:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration