shell script remove file if exists
#!/bin/bash file="file_you_want_to_delete" if [ -f "$file" ] ; then rm "$file" fi
Source: stackoverflow.com
#!/bin/bash file="file_you_want_to_delete" if [ -f "$file" ] ; then rm "$file" fi