#!/bin/bash usage() { echo echo "Usage:" echo " $(basename $0) /path/to arch" echo echo " supported arches are 32 and 64 -bit" echo " e.g. search for 64-bit files" echo " $(basename $0) /var/tmp/magebuild/builded 64" echo exit 1 } [[ $# -lt 2 ]] && usage [[ $2 != 32 ]] && [[ $2 != 64 ]] && usage for i in $(find $1 -type f) do [[ -n $(file ${i} | grep "$2-bit") ]] && echo "$2-bit: ${i}" done