Hareesh Haridas wrote: > > hi all, > > is there a method/command in linux to empty the contents of a file > without deleting it ? i mean something which does the equivalent of: > -- > bash$rm -f filename > bash$touch filename > -- > with the 'rm' part being replaced by a process which deletes all data ? > i tried RTFM but failed.
This may help: [mahantesh@mymachine mahantesh]$ touch testing.txt [mahantesh@mymachine mahantesh]$ vi testing.txt ^ ^ ^ type some text them save it (:wq!) [mahantesh@mymachine mahantesh]$ cat /dev/null > testing.txt [mahantesh@mymachine mahantesh]$ cat testing.txt. Greetz! Mahantesh. ------------------------------------------------------- This sf.net email is sponsored by: Dice - The leading online job board for high-tech professionals. Search and apply for tech jobs today! http://seeker.dice.com/seeker.epl?rel_code=31 _______________________________________________ linux-india-help mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/linux-india-help
