Personal notes
Approach the file with a specific name in the directory.
If you want to gzip all the .dat files named hoge in the current directory,
find . -name "hoge*.dat" -exec gzip -v '{}' \;
If you want to gzip hoge01.dat to hoge **. dat excluding hoge00.dat
find . -name "hoge*.dat" -not -name "*00*" -exec gzip -v '{}' \;
By the way, if you want to move
find . -name "hoge*.dat" -not -name "*00*" -exec mv '{}'Directory path name\;
It's easy to apply.
I used it as a reference ↓ Set complex search conditions with the find command
Recommended Posts