In my present directory I have many folders like F1, F2, F3, F4, F5, F6, F7, F8, F9, F10.
I have a csv file "dan.csv" in the present directory which has a column with folder names.
csv file looks like below: Column name is "id"
id
F1
F4
F5
F6
F8
F10
Based on their match in the csv file I would like to move the folders to a new directory "DAN".
To do this I tried like below:
xargs -a <(tail -n +2 dan.csv) -I{} sh -c '[ -d "{}" ] && mv -t DAN "{}"'
This didn't throw any error and also didn't move the folders into new directory "DAN".
No comments:
Post a Comment