Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command Help

Status
Not open for further replies.

stu78

Programmer
May 29, 2002
121
GB
Hi,

I want to clear the contents of a file, I don't want to delete it etc. I seem to remember there being a cat command to do this, but can't seem to remember..... Has anyone any ideas on this.

Thanks,
Stewart.
 
Hi Stewart,

with sed you can do:

$ sed '1,$d' file > file

Alternatively you can execute one of the following comands:

$ > file (Bourne or Korn Shell)

$ cp /dev/null file (C Shell)

Hope that helps!

mrjazz [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top