Trying to delete file "a.txt"
This works,
[ -f "a.txt" ] && rm -v -f a.txt
However, following syntax doesn't work if I want to delete multiple files "a.txt", "a.txt.bak1", "a.txt.bak2"
[ -f "a.txt*" ] && rm -v -f a.txt*
Can you help?
Trying to delete file "a.txt"
This works,
[ -f "a.txt" ] && rm -v -f a.txt
However, following syntax doesn't work if I want to delete multiple files "a.txt", "a.txt.bak1", "a.txt.bak2"
[ -f "a.txt*" ] && rm -v -f a.txt*
Can you help?
Why not use find names that match the pattern and then do the operation (including file check) using exec?
For example:
$ find . -maxdepth 1 -name "*.scala" -type f -exec \md5sum {} \;
./dir1/analysis.scala
./soft/zla.scala
However, here it is