shell script to remove a file if it already exist

前端 未结 7 1097
面向向阳花
面向向阳花 2021-01-30 15:43

I am working on some stuff where I am storing data in a file. But each time I run the script it gets appended to the previous file.

I want help on how I can remove the f

相关标签:
7条回答
  • 2021-01-30 16:07

    If you want to ignore the step to check if file exists or not, then you can use a fairly easy command, which will delete the file if exists and does not throw an error if it is non-existing.

     rm -f xyz.csv
    
    0 讨论(0)
提交回复
热议问题