anonymouse2@sh.itjust.works to Programming@programming.dev · 7 hours agoHow Good at Math Does a Programmer Need to Be?plus-squaremessage-squaremessage-square37fedilinkarrow-up152arrow-down10
arrow-up152arrow-down1message-squareHow Good at Math Does a Programmer Need to Be?plus-squareanonymouse2@sh.itjust.works to Programming@programming.dev · 7 hours agomessage-square37fedilink
minus-squareanonymouse2@sh.itjust.workstoAsklemmy@lemmy.ml•What's a handy terminal command you use often?linkfedilinkarrow-up9·2 months agoLet’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. linkfedilink
minus-squareanonymouse2@sh.itjust.workstoAsklemmy@lemmy.ml•What's a handy terminal command you use often?linkfedilinkarrow-up9·2 months agoI recently learned to use a for loop on the command line to organize hundreds of files in a few seconds. linkfedilink
minus-squareanonymouse2@sh.itjust.workstoAsklemmy@lemmy.ml•Could you do me a favour and make this post look like a Reddit post?linkfedilinkarrow-up3·edit-22 months ago“I’ll get off Facebook now!”, he said and though he really tried Those Russian bots still hacked his shit …and Timmy fucking died. linkfedilink
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.