Re: command error redirection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Gopal Ghosh wrote:
Dear All,
How top redirect errors of a command to a file

There are three useful things to do:
1 - redirect only stderr (fd 2)
	command 2>file.err
2 - redirect stdout and stderr to a file
	command &>file.log
3 - use the script command to capture ALL output
    (generally better than option 2)
	script file.log
	# you are now in a sub-shell
	{run your command}
	exit
	# here you are back to the login shell

See the man page for the script command, you can append to a log as well, and you get start and stop times in the log, useful when you read it a week later. ;-)

--
Bill Davidsen <davidsen@xxxxxxx>
  "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux