how can i remove duplicated variants from vcf file? i googled and searched in biostars history but i did not fond any way to do it.
> . in fact i intend to remove variants that are same in scoffold id and pos and keep one of them.

I strongly suggest you also use the REF information...

sort on CHROM/POS/REF.
using awk create a KEY=CHROM\tPOS\REF, print the line if the key wasn't found previously

    LC_ALL=C sort -t $'\t' -k1,1 -k2,2n -k4,4  input.vcf |\
    awk -F '\t' '/^#/ {print;prev="";next;} {key=sprintf("%s\t%s\t%s",$1,$2,$4);if(key==prev) next;print;prev=key;}' 


edit: added 'next; ' for VCF header. 