skip to main | skip to sidebar

Daily Vim: Text Editor Tips, Tricks, Tutorials, and HOWTOs

A blog dedicated to text editing and general exploration of computing knowledge

Showing posts with label truncate. Show all posts
Showing posts with label truncate. Show all posts

Friday, April 11, 2008

Quickly Truncate a File

Quick shell tip:

If you want to truncate a file to zero bytes from the command-line, here's an easy way.

user@host [~]$ > filename

I used to use:

user@host [~]$ cp /dev/null filename

But the first approach is less typing.
Posted by Travis Whitton at 5:54 AM 2 comments:
Labels: bash, file, truncate
Older Posts Home
Subscribe to: Posts (Atom)

Donate

Donate Bitcoins

Blog Archive

  • ▼  2014 (3)
    • ▼  January (3)
      • Generating Mock Userdata
      • Removing Lines that Don't Match a Pattern
      • Finding and Replacing Unicode Characters
  • ►  2013 (14)
    • ►  December (2)
    • ►  November (6)
    • ►  October (6)
  • ►  2009 (74)
    • ►  December (4)
    • ►  November (18)
    • ►  October (6)
    • ►  September (3)
    • ►  July (2)
    • ►  June (10)
    • ►  May (1)
    • ►  April (9)
    • ►  March (6)
    • ►  February (3)
    • ►  January (12)
  • ►  2008 (143)
    • ►  December (6)
    • ►  November (5)
    • ►  October (6)
    • ►  September (15)
    • ►  August (25)
    • ►  July (6)
    • ►  June (16)
    • ►  May (15)
    • ►  April (22)
    • ►  March (16)
    • ►  February (9)
    • ►  January (2)
  • ►  2007 (20)
    • ►  December (4)
    • ►  November (16)

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments