Posted on 8th February 2010One Response
How To Output “the Command’s Output” To A Text File In Unix?

hi, i am working on solaris
trying to execute this command.
du -k /lpg
the command works ok but i want the output not to be displayed on screen but instead to be written in a text file.
i tried this but it didnt work.
du -k /lpg > /izmir1/output.txt
Somebody has an idea?

Comments
comment by Gandalf Parker
Posted on February 8, 2010 at 7:34 pm

it depends on what shell you are running but Im guessing that you want to direct BOTH the normal output and the error output.
Try this….
du -k /lpg >& /izmir1/output.txt

Leave a Response
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Improve the web with Nofollow Reciprocity.