Clear the contents of a file

KitaraFR Posted messages 2 Status Member -  
zipe31 Posted messages 34620 Registration date   Status Contributor Last intervention   -
Hello everyone,

I want to clear the content of a shell file with a single command line. I don't want to use "rm" because I want to keep the file, just empty.
How can I clear its content?

Thank you :D

Configuration: Windows 7 / Firefox 4.0

3 answers

  1. boly38 Posted messages 267 Registration date   Status Member Last intervention   80
     
    echo "" > myfile
    2
  2. KitaraFR Posted messages 2 Status Member
     
    Okay, it's as simple as that.
    Thank you :)
    0
    1. boly38 Posted messages 267 Registration date   Status Member Last intervention   80
       
      Can you mark this question as resolved?
      0
  3. zipe31 Posted messages 34620 Registration date   Status Contributor Last intervention   6 502
     
    Hi,

    Or simply if we are really lazy:

    > myfile

    ;-))
    --
    Zen my nuggets ;-)
    Do your part for the environment, close your windows and adopt a penguin.
    0