Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Nov 2004 14:18:03 -0500
From:      "Haulmark, Chris" <chris@sigd.net>
To:        "CHris Rich" <freebsdnews@gmail.com>, <freebsd-questions@freebsd.org>
Subject:   RE: Outputting command to a text file
Message-ID:  <6FC9F9894A9F8C49A722CF9F2132FC220257938D@ms05.mailstreet2003.net>

next in thread | raw e-mail | index | archive | help
Someone broke the silence:=20

> I want to use the du command to check on the sizes of files in a
> directory, but i want the output to be put into a text file so I can
> look at it later.=20
>

Use the character > at the end of your command to redirect it to =
wherever you want.

For example,  if I was to want the output of du results to a file named =
du.log in the /home/chris directory, I would do this:

du -d 1 -h / > /home/chris/du.log

If I wanted to do it again but to have it added at the end of du.log.  I =
would use two >>.

du -d 1 -h / >> /home/chris/du.og

Remember, if you use one >, you will wipe out the original results and =
replace it with the newer results.

Files are not the only thing you can usually use after the > character.

=20
> I did some search on google, and found nothing that applied.
> Searched other places (lists and things) and couldn't find what i was
> looking for, perhaps i was using the wrong search terms.
>=20
> Any help will be greatly appreciated
>=20
> Thanks
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscribe@freebsd.org"

--
Chris Haulmark
System Admin. Freelancer
"In market for IT corrections for a salary."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6FC9F9894A9F8C49A722CF9F2132FC220257938D>