Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I can't test this at my current location, but I think that this will work as well:
That would actually delete the entire file's contents. dG is just as good, except you'd need to start from line 1 to get it to remove the whole thing. Then of course there is the "> filename" suggestion. All of those ways would work fine (assuming I'm right about d%).
EDIT : The following is the correct method:
Thanks, Mr. C.!
Last edited by KasMage; 07-30-2008 at 08:22 AM.
Reason: Edited in corrected operation
He's talking about cleaning out a 3GB file (see OP). I still think doing it at the cmd line makes more sense. No need to go into an editor. Remember vi/vim makes a temp backup while the file is open...
Incidentally, 'dd' only deletes 1 line.