Tip Details Add a Related Tip

Rate as: Positive Negative

Empty the contents of a file

For *nix users, here's a command you can use to clear out the contents of a file without having to delete the file and create it new again (which can be especially big hassle if you have to change file permmissions)

cat /dev/null > THE_NAME_OF_YOUR_FILE

Nothing earth shattering. But I find this useful for dealing with some types of log files. When they get too a certain size and I want to delete them and start again I can use this command to delete the contents without having to create the file again.
Rating: no ratings, 0 total Votes
Categories: UNIX linux
Added: on Aug 21, 2008 at 9:09 am
Added By: an anonymous user

Comments on this Tip

Add a Comment
There are no comments for this tip
Your Comment:
(how to format)
Rate This Tip:

Verify Humanity:
Sorry, we know it's annoying, but please enter the characters shown in the image to the left so that we know you're an actual person and not an evil spammer. Thanks.
       

Related Tips

ssh and scp without passwords

Categories: shell Mac linux UNIX
100% positive, 1 comment - last added on Jun 20, 2008 at 9:19 am
– Tip added by an anonymous user on Dec 21, 2007 at 2:51 pm

Color coding the ls command in Fedora

100% positive, 0 comments
– Tip added by an anonymous user on Apr 25, 2008 at 8:27 am

Forcing users to change their password

no ratings, 0 comments
– Tip added by an anonymous user on Sep 30, 2008 at 11:27 am

Software Development Automation with Scripting Languages

Categories: linux unix scripting
no ratings, 0 comments
– Tip added by an anonymous user on Jun 05, 2008 at 2:40 pm

Running X11 programs from the terminal

no ratings, 0 comments
– Tip added by an anonymous user on Jan 28, 2008 at 8:04 am

Changing an already running job to execute in the background

Categories: linux UNIX Mac
no ratings, 0 comments
– Tip added by an anonymous user on Aug 06, 2007 at 11:57 am

Update your shell prompt

Categories: UNIX Mac linux shell
no ratings, 0 comments
– Tip added by an anonymous user on Jun 04, 2007 at 9:15 pm

Get the Chrome browser on Mac and Linux

100% positive, 0 comments
– Tip added by an anonymous user on Sep 16, 2008 at 11:58 am

Enable the login shell for the Gnome terminal

100% positive, 0 comments
– Tip added by an anonymous user on Jul 15, 2008 at 10:46 am

Build your own cheap computer

Categories: Computers frugal linux kids
100% positive, 0 comments
– Tip added by an anonymous user on Jun 04, 2008 at 4:38 pm

Backing up a Linux machine

100% positive, 0 comments
– Tip added by an anonymous user on Mar 19, 2008 at 3:19 pm

Fedora update kills log rolling

Categories: Fedora linux repair bugs
100% positive, 1 comment - last added on Feb 29, 2008 at 7:39 am
– Tip added by an anonymous user on Feb 28, 2008 at 7:29 am

Open a list of files in vim from a grep command (linux)

Categories: web design linux
100% positive, 0 comments
– Tip added by an anonymous user on Jan 10, 2008 at 12:26 pm

Taking screen shots in Linux

Categories: linux screenshots free
no ratings, 0 comments
– Tip added by an anonymous user 5 days, 13 hours ago

Install Debian on a G1 phone

no ratings, 0 comments
– Tip added by an anonymous user on Nov 13, 2008 at 3:48 pm

Photobooth for Linux

no ratings, 0 comments
– Tip added by an anonymous user on Nov 07, 2008 at 11:34 am

Custom keyboard shortcuts in Gnome

no ratings, 0 comments
– Tip added by an anonymous user on Nov 05, 2008 at 9:52 am

Get rid of the OpenOffice splash screen on Linux

no ratings, 0 comments
– Tip added by an anonymous user on Oct 16, 2008 at 2:04 pm

up2date failed dependencies

Categories: red hat linux Fedora
no ratings, 0 comments
– Tip added by an anonymous user on Aug 20, 2008 at 10:25 am

Adding programs to the iBar in gOS

Categories: gOS linux customization
no ratings, 0 comments
– Tip added by an anonymous user on Feb 03, 2008 at 12:17 pm