I have text files in certain sub folders like
home/andhra1/node1/*.txt files and
I have to all files from different sub directories to one directory.
below is the shell script which i wrote
fromPath='source path' echo $fromPath file='destination path/*.pdf' echo $file toPath='destination path' echo $toPath for i in $file; do filePath=$i if [ -e $filePath ]; then echo $filePath yes | cp -rf $filePath $toPath else echo 'no files' fi done