Each read in a SAM/BAM/CRAM file has a binary flag. I find it very difficult to remember what they mean and build up a flag that does what I need.
This site (http://broadinstitute.github.io/picard/explain-flags.html) is very hard to find when I need it, but very useful. It both explain each bit and allow to build the flag you need.
to use with
samtools view -f or
samtools view -F