I have a folder with around 150 text files. I would like to create folders in the name of the 150 files. After that I would like the text file to be moved to its respective folder.
Example names of the files inside myfolder directory:
~/myfolder/
|______ ajhaslf.txt
|______ oiueed.txt
|______ dsflije.txt
How I would like my new structure to be:
~/myfolder/
|______ ajhaslf
|____ajhaslf.txt
|______ oiueed
|____oiueed.txt
|______ dsflije
|____dsflije.txt
Of course creating directory with the filenames is not a problem for me with mkdir.
cdinto your folder and:for file in *.txt; do mkdir -- "${file%.txt}"; mv -- "$file" "${file%.txt}"; done"${file%.txt}"? What is your shell?GmZzz3StdPk.txt.txt?