Fastest way to create 1000 folders one inside another and put a file in the last folder
c, file, hierarchy, linux, ubuntu
Solution
Type the following in your shell:
mkdir -p folder$( seq -s "/folder" 999 )1000
Then you can enter this folder:
cd folder$( seq -s "/folder" 999 )1000
and create a file:
touch david.txt
and come back to your previous dir:
cd -
Problem
I've written a code for searching a specific file , where the user enters a `starting path` and a `filename` , and then the program prints its details if the file exists , or prints `not found` otherwise. The code is based on recursion . I want to test it with a large folder hierarchy , let's say 1000 folders , one inside the other , and put a file called `david.txt` inside the 1000th folder . How can I do that without creating 1000 times folders for the next 3 hours ? The code is written in `C` , under `Ubuntu` . Thanks