I am using cp command in ma bash script
cp /source/* /destination
I just want to avoid copying all .txt file from my source to destination.
If extended globulation is enabled, you can match al files except txt ones:
cp /source/!(*.txt) /destination
*.txt matches all txt files. The !(...) tells it to match everything except what's in the ... part.
shopt -s extglob.I don't know if you can do this in copy but the rsync command has this ability. Try
rsync -av /source/* /destination --exclude "*txt".
See https://www.howtogeek.com/168009/how-to-exclude-files-from-rsync/ for some more details and examples.