Terminal Output to a File ??

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. :b:

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.

Hey,

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.:b: