We can copy some file by extensions like this:
cp *.txt ../new/
but how can I copy all files that have no extension?
cpfilenamesshellwildcards
We can copy some file by extensions like this:
cp *.txt ../new/
but how can I copy all files that have no extension?
Best Answer
The answer from @ubaid-ashraf is almost there. The way to specify file with no extension, in
ksh
would be:so that any file with dot in file name is skipped.
For that to work in
bash
, you need to enable theextglob
option (shopt -s extglob
) and thekshglob
option inzsh
(set -o kshglob
).