LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-06-2005, 01:31 PM   #1
ilnli
Member
 
Registered: Jul 2004
Location: Pakistan
Distribution: Slackware 10.0, SUSE 9.1, RH 7, 7.3, 8, 9, FC2
Posts: 413

Rep: Reputation: 32
log the output


how can I get the output of a command on the stdout and also in a file?

i have to telnet on a remote site and I want to log all the output in a file too how can i do that ?
 
Old 01-06-2005, 02:09 PM   #2
stanleyg76
LQ Newbie
 
Registered: Dec 2004
Posts: 16

Rep: Reputation: 0
you can do the following:

% ls | tee /tmp/xx

will show output on the screen and also log it into /tmp/xx file.
Do 'man tee' to see more information about that command.
 
Old 01-06-2005, 02:41 PM   #3
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
u can also use the redirector operator

> and >>
one will make a new file while the other will append the O/P to the existing file if any

ls >> /tmp/test

regards
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
configure/make - output log The_JinJ Linux - Newbie 1 12-04-2004 08:28 AM
No output to /var/log/messages or ~syslog eelriver Slackware 5 07-18-2004 06:13 AM
VSFTPD.log nonstandard output RedHat 9 tobyconyers Linux - Newbie 0 11-17-2003 11:56 AM
Log Screen Output to a file sdandeker Linux - Newbie 3 09-17-2003 03:57 AM
Log output change Stephanie_new Linux - General 6 06-18-2002 03:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:45 PM.

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