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

