Skip to main content
added 253 characters in body
Source Link
FelixJN
  • 14.1k
  • 2
  • 36
  • 55

Since you have a fixed format and given prefix, the approach is pretty simple:

cp files fixed_name_???

or

cp files fixed_name_[0-9][0-9][0-9]

Explanation: A ? replaces any character but specifically one only (in contrast to *), [0-9] stands for one digit in the range 0 to 9. Thus the above ways replace three chracters (or digits).

If there is no other directory like this, the asterisk wildcard (standing for none, one or more characters) will work, too:

cp files fixed_name_*

Be aware that in all cases you might need quotes in case of e.g. spaces in your directory names and that it only works if there is no other directory called fixed_name_XXX.

Since you have a fixed format and given prefix, the approach is pretty simple:

cp files fixed_name_???

or

cp files fixed_name_[0-9][0-9][0-9]

Explanation: A ? replaces any character but specifically one only (in contrast to *), [0-9] stands for one digit in the range 0 to 9. Thus the above ways replace three chracters (or digits).

Since you have a fixed format and given prefix, the approach is pretty simple:

cp files fixed_name_???

or

cp files fixed_name_[0-9][0-9][0-9]

Explanation: A ? replaces any character but specifically one only (in contrast to *), [0-9] stands for one digit in the range 0 to 9. Thus the above ways replace three chracters (or digits).

If there is no other directory like this, the asterisk wildcard (standing for none, one or more characters) will work, too:

cp files fixed_name_*

Be aware that in all cases you might need quotes in case of e.g. spaces in your directory names and that it only works if there is no other directory called fixed_name_XXX.

Source Link
FelixJN
  • 14.1k
  • 2
  • 36
  • 55

Since you have a fixed format and given prefix, the approach is pretty simple:

cp files fixed_name_???

or

cp files fixed_name_[0-9][0-9][0-9]

Explanation: A ? replaces any character but specifically one only (in contrast to *), [0-9] stands for one digit in the range 0 to 9. Thus the above ways replace three chracters (or digits).