Skip to content

Instantly share code, notes, and snippets.

@nodew
Last active April 19, 2017 08:51
Show Gist options
  • Save nodew/4d30917bfa15bf61378e1beffa8bffcd to your computer and use it in GitHub Desktop.
Save nodew/4d30917bfa15bf61378e1beffa8bffcd to your computer and use it in GitHub Desktop.
recursively find out all file under a folder
path=$1
ignoreFolder=$2
walk() {
ss=${1#*${2}}
if [[ $ss == "" ]]; then
return
fi
if [[ -d $1 ]]; then
sub=`ls $1`
for f in $sub
do
p=`echo ${1}/${f}`
walk $p $2
done
elif [[ -f $1 ]]; then
echo $1
fi
}
walk $path $ignoreFolder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment