Thursday, December 22, 2011

How to empty a Unix file system with cat /dev/null command dev null

First take the backup of existing file :

$cp dev_rd.log /sapcd/XVPdev


then empty the file

$cat /dev/null > dev_rd.log

still it was giving error : File exists.

It meant that noclobber option is set so gave command

$cat /dev/null >! dev_rd.log

and it worked

0 comments: