• 5 Posts
  • 49 Comments
Joined 7 months ago
cake
Cake day: May 1st, 2024

help-circle











  • Let’s say, for example, you have a directory of files named x01-001; x01-002; x02-001; x02-002; x03-001… and so on.

    I want to create subdirectories for each ‘x’ iteration and move each set to the corresponding subdirectory. My loop would look like this:

    for i in {1…3}; do mkdir Data_x0$i && mv x0$i* Data_x0$i; done

    I’ve also been using it if I need to rename large batches of files quickly.