I have a fastq files and I found many reads with only N. I want to filter only those reads which contains N. 
Any one liner for that?
To separate reads with Ns using BBMap:

    bbduk.sh in=reads.fq out=readsWithoutNs.fq outm=readsWithNs.fq maxns=0

If you have, say, 100bp reads and only want to separate reads containing all 100 Ns, change that to "maxns=99".