Skip to main content
added 160 characters in body
Source Link
Stéphane Chazelas
  • 586.3k
  • 96
  • 1.1k
  • 1.7k

The answer from @ubaid-ashraf is almost there. The way to specify file with no extension, in ksh would be:

cp -- !(*.*) /new/path/ 

so that any file with dot in file name is skipped.

For that to work in bash, you need to enable the extglob option (shopt -s extglob) and the kshglob option in zsh (set -o kshglob).

The answer from @ubaid-ashraf is almost there. The way to specify file with no extension would be

cp !(*.*) /new/path/ 

so that any file with dot in file name is skipped.

The answer from @ubaid-ashraf is almost there. The way to specify file with no extension, in ksh would be:

cp -- !(*.*) /new/path/ 

so that any file with dot in file name is skipped.

For that to work in bash, you need to enable the extglob option (shopt -s extglob) and the kshglob option in zsh (set -o kshglob).

Source Link
Abel Cheung
  • 621
  • 1
  • 4
  • 15

The answer from @ubaid-ashraf is almost there. The way to specify file with no extension would be

cp !(*.*) /new/path/ 

so that any file with dot in file name is skipped.