What is the history of the bandanna as seen in the American West?

by sonnyclips
sonnyclips

It seems like there might be some common history to the keffiyeh or Cambodian Kroma so I wondered if any experts might no the background?