wget http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeBroadHistone/files.txt grep broadPeak files.txt | cut -f 1 | grep "H[234]" | grep 12878 > histone.peak.files.txt for file in `cat histone.peak.files.txt`; do wget http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeBroadHistone/${file}; done