So, you can use the *
as a wild card for all files when using cp
within context of a directory. Is there a way to copy all files except x
file?
Bash Command – How to Copy Some, But Not All Files
bashshellwildcards
Related Question
- bash shell wildcards – How to Delete All Files Except *.txt in Linux
- Copying Files with Multiple Extensions in Bash
- Shell – copy all files that have no extension
- Bash – How to recursively remove all but list of files
- Shell Wildcards – Why Wildcard Character * Differs Between Zip and RM Commands
- Bash – Difference between * and ?* glob in Bash
Best Answer
In
bash
you can useextglob
:where
!(b*)
exclude allb*
files.You can later disable
extglob
with