I am beginner especially in working with Unix shell.
Is there a way to do following:
for each file (around 50) in directory make a subdirectory. Subdirectory should ideally be named as file or as number (from 1-50)
Move files to corresponding subdirectories
Starting from main directory, for each subdirectory, use file in that subdirectory for further analysis (perform code on it, already written)
I will really appreciate your help. Thanks a lot.
ls > file.txt
, move file.txt to the dir_results and usexargs -d '\n' mkdir -p -- < file.txt
to create directories. That covers the creation of the dirs. :) – Rinzwind Oct 27 '20 at 17:19