Reputation: 1806
"/home/shell/DELETE-ME-*"
which includes all the files that starts with DELETE-ME- in shell directory.
In the same fashion, would like to excludes all the files that starts with DELETE-ME-
tried ^[DELETE-ME-]
,^[DELETE-ME-*]
, but haven't worked.
Upvotes: 2
Views: 118
Reputation: 20970
Looks like a job for extglob
shopt -s extglob
echo !(DELETE-ME-*) # change echo to your actual command...
shopt -u extglob
Upvotes: 0
Reputation: 784898
How about using grep -v
:
printf "%s\n" /home/shell/* | grep -v '/DELETE-ME-'
OR using find:
find /home/shell -maxdepth 1 -type f ! -name "DELETE-ME-*"
Upvotes: 1