| | |
need to create 1000's of directories using shell script
![]() |
•
•
Join Date: Dec 2008
Posts: 10
Reputation:
Solved Threads: 0
Hi all,
I need to create thousands of directories in a single parent directory using shell scripting code. One problem would be to generate the unique directory name for each of the 1000 iterations to create a directory every time. ie first time the directory name needs to be subdir1 and then subdir2 for the next iteration and so on.
Could anyone please help me with the script?
Thanking you,
Prashanth
I need to create thousands of directories in a single parent directory using shell scripting code. One problem would be to generate the unique directory name for each of the 1000 iterations to create a directory every time. ie first time the directory name needs to be subdir1 and then subdir2 for the next iteration and so on.
Could anyone please help me with the script?
Thanking you,
Prashanth
Last edited by prashanth s j; Jul 5th, 2009 at 10:34 am. Reason: spelling mistake: modified first name to first time
'seq' may not work in all environments.
Here is the code.
to delete again:
Here is the code.
Shell Scripting Syntax (Toggle Plain Text)
!#/bin/bash for((j=1;j<=1000;j++));do mkdir subdir_$j 2> /dev/null done
to delete again:
Shell Scripting Syntax (Toggle Plain Text)
!#/bin/bash for((j=1;j<=1000;j++));do rmdir subdir_$j 2> /dev/null done
Last edited by Dream2code; Jul 14th, 2009 at 12:59 pm.
![]() |
Similar Threads
- Help with basic shell script (Shell Scripting)
- How to Create a shell script to test the telnet connection status (Shell Scripting)
- help parsing log (Shell Scripting)
- Convert shell script for looping (Shell Scripting)
- Need help in Shell script (Shell Scripting)
- Creating shell script that use snort (Shell Scripting)
- Shell Script Issue (Shell Scripting)
- Linux Shell Script needs help writing program (Shell Scripting)
Other Threads in the Shell Scripting Forum
- Previous Thread: dead.letter issue
- Next Thread: Create a batch file that executes C# application
| Thread Tools | Search this Thread |






