![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to redirect my output in a new terminal | Sayantan | SUN Solaris | 0 | 06-29-2007 07:01 AM |
| terminal output - save to file? | frustrated1 | SUN Solaris | 2 | 11-15-2005 09:19 AM |
| output to terminal | andreis | High Level Programming | 6 | 10-16-2003 05:59 AM |
| Output to terminal and file at the same time | Charlie | UNIX for Dummies Questions & Answers | 1 | 11-15-2001 09:19 AM |
| connecting to unix through hyper terminal - as a dumb terminal | michelle | UNIX for Advanced & Expert Users | 2 | 11-05-2001 03:32 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hey,
How can I transfer the terminal output to a file ? For example : command "fuser" returns the "process-id" and prints the output on the terminal, but I want that output to a file as well. How can I do that ? /clocal/mqbrkrs/user/mqsiadm/sanjay/AccessMonitor $ fuser -uf /clocal/mqbrkrs/user/mqsiadm/sanjay/AccessMonitor OUTPUT ON TERMINAL : /clocal/mqbrkrs/user/mqsiadm/sanjay/AccessMonitor: 1327500c(mqsiadm) And I want this output to a file. In general, the commands that gives output to the terminal or returns somthing, how can we get those to the file ? I know about the 1> and 2> redirections. What I am talking about, is redirection the output from Terminal to a File. Can anyone help me !! Thanks in advance ! Varun. |
|
||||
|
The standard way of redirecting the output of a command into a file is to use the 'tee' command:
# Starts 'my_command' command and duplicates # the outputs from the standard and error devices # into the 'my_log.txt' log file my_command 2>&1 | tee my_log.txt Hope it helps, C. |
|
||||
|
Quote:
Thanks man...I got it. ==================================================== Examples 1 To view and save the output from a command at the same time: lint program.c | tee program.lint This displays the standard output of the command lint program.c at the workstation, and at the same time saves a copy of it in the file program.lint. If a file named program.lint already exists, it is deleted and replaced. 2 To view and save the output from a command to an existing file: lint program.c | tee -a program.lint This displays the standard output of the lint program.c command at the workstation and at the same time appends a copy of it to the end of the program.lint file. If the program.lint file does not exist, it is created. ==================================================== Thanks, Varun. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|