I have a problem with mass creation files and directories. I want to create something like this:
dummy_directory_1/dummy_file_1 dummy_directory_2/dummy_file_2 dummy_directory_3/dummy_file_3
using a loop:
for(( i=1; $i <=1000; i++ )); do mkdir $(date --date="$i day ago" +%Y%m%d%H%M%S); touch $(date --date="$i day ago" +%Y%m%d%H%M%S)/$(date --date="$i day ago" +%Y%m%d%H%M%S)_file; done
Not all files are created because I get the following errors:
touch: cannot touch `20140211230556/20140211230556_file': No such file or directory touch: cannot touch `20131105230559/20131105230559_file': No such file or directory touch: cannot touch `20130529000604/20130529000604_file': No such file or directory
Did you know that bash / linux has some limitations for creating a file? I had a similar problem when I made a script to search for many files using grep. If I change the cycle $i<=10 , it works. Please, help.
source share