How to create multiple files(100 files) and they can contain 30 random characters in each of them
up vote
-1
down vote
favorite
I need to create 100 files using script Linux which contain 30 random characters password and that password contain only strings, small letters and big letters.
// #!/bin/bash
for n in {1..100}; do
dd if=/dev/urandom of=/mnt/mymnt/passwords/only_numbers_and_lettersNUM.txt$( printf %03d "$n" ).bin bs=1 count=$(( RANDOM + 1024 ))
head /dev/urandom | tr -dc A-Za-z0-9 | head -c 30 ; echo ''
done //
Thanks in advance.
linux
New contributor
add a comment |
up vote
-1
down vote
favorite
I need to create 100 files using script Linux which contain 30 random characters password and that password contain only strings, small letters and big letters.
// #!/bin/bash
for n in {1..100}; do
dd if=/dev/urandom of=/mnt/mymnt/passwords/only_numbers_and_lettersNUM.txt$( printf %03d "$n" ).bin bs=1 count=$(( RANDOM + 1024 ))
head /dev/urandom | tr -dc A-Za-z0-9 | head -c 30 ; echo ''
done //
Thanks in advance.
linux
New contributor
2
There doesn't appear to be a question here. Please could you describe why what you've tried doesn't work?
– Roger Lipscombe
2 days ago
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I need to create 100 files using script Linux which contain 30 random characters password and that password contain only strings, small letters and big letters.
// #!/bin/bash
for n in {1..100}; do
dd if=/dev/urandom of=/mnt/mymnt/passwords/only_numbers_and_lettersNUM.txt$( printf %03d "$n" ).bin bs=1 count=$(( RANDOM + 1024 ))
head /dev/urandom | tr -dc A-Za-z0-9 | head -c 30 ; echo ''
done //
Thanks in advance.
linux
New contributor
I need to create 100 files using script Linux which contain 30 random characters password and that password contain only strings, small letters and big letters.
// #!/bin/bash
for n in {1..100}; do
dd if=/dev/urandom of=/mnt/mymnt/passwords/only_numbers_and_lettersNUM.txt$( printf %03d "$n" ).bin bs=1 count=$(( RANDOM + 1024 ))
head /dev/urandom | tr -dc A-Za-z0-9 | head -c 30 ; echo ''
done //
Thanks in advance.
linux
linux
New contributor
New contributor
edited 2 days ago
New contributor
asked 2 days ago
Onyic
12
12
New contributor
New contributor
2
There doesn't appear to be a question here. Please could you describe why what you've tried doesn't work?
– Roger Lipscombe
2 days ago
add a comment |
2
There doesn't appear to be a question here. Please could you describe why what you've tried doesn't work?
– Roger Lipscombe
2 days ago
2
2
There doesn't appear to be a question here. Please could you describe why what you've tried doesn't work?
– Roger Lipscombe
2 days ago
There doesn't appear to be a question here. Please could you describe why what you've tried doesn't work?
– Roger Lipscombe
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
#!/bin/bash
for n in {1..100}; do
{ < /dev/urandom tr -dc A-Za-z | head -c${1:-30};echo; } > /mnt/mymnt/passwords/$n
done
New contributor
Thanks gopy, but I still need the files to be created in the directory " /mnt/mymnt/passwords " and with the name " only_numbers_and_lettersNUM.txt "
– Onyic
2 days ago
@NourJandali: Then you improve the above script to suit your needs
– Basile Starynkevitch
2 days ago
1
I updated the answer
– gopy
2 days ago
what would you like to name the files?
– gopy
2 days ago
@BasileStarynkevitch I am new to Linux.
– Onyic
2 days ago
|
show 3 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
#!/bin/bash
for n in {1..100}; do
{ < /dev/urandom tr -dc A-Za-z | head -c${1:-30};echo; } > /mnt/mymnt/passwords/$n
done
New contributor
Thanks gopy, but I still need the files to be created in the directory " /mnt/mymnt/passwords " and with the name " only_numbers_and_lettersNUM.txt "
– Onyic
2 days ago
@NourJandali: Then you improve the above script to suit your needs
– Basile Starynkevitch
2 days ago
1
I updated the answer
– gopy
2 days ago
what would you like to name the files?
– gopy
2 days ago
@BasileStarynkevitch I am new to Linux.
– Onyic
2 days ago
|
show 3 more comments
up vote
1
down vote
#!/bin/bash
for n in {1..100}; do
{ < /dev/urandom tr -dc A-Za-z | head -c${1:-30};echo; } > /mnt/mymnt/passwords/$n
done
New contributor
Thanks gopy, but I still need the files to be created in the directory " /mnt/mymnt/passwords " and with the name " only_numbers_and_lettersNUM.txt "
– Onyic
2 days ago
@NourJandali: Then you improve the above script to suit your needs
– Basile Starynkevitch
2 days ago
1
I updated the answer
– gopy
2 days ago
what would you like to name the files?
– gopy
2 days ago
@BasileStarynkevitch I am new to Linux.
– Onyic
2 days ago
|
show 3 more comments
up vote
1
down vote
up vote
1
down vote
#!/bin/bash
for n in {1..100}; do
{ < /dev/urandom tr -dc A-Za-z | head -c${1:-30};echo; } > /mnt/mymnt/passwords/$n
done
New contributor
#!/bin/bash
for n in {1..100}; do
{ < /dev/urandom tr -dc A-Za-z | head -c${1:-30};echo; } > /mnt/mymnt/passwords/$n
done
New contributor
edited 2 days ago
New contributor
answered 2 days ago
gopy
946
946
New contributor
New contributor
Thanks gopy, but I still need the files to be created in the directory " /mnt/mymnt/passwords " and with the name " only_numbers_and_lettersNUM.txt "
– Onyic
2 days ago
@NourJandali: Then you improve the above script to suit your needs
– Basile Starynkevitch
2 days ago
1
I updated the answer
– gopy
2 days ago
what would you like to name the files?
– gopy
2 days ago
@BasileStarynkevitch I am new to Linux.
– Onyic
2 days ago
|
show 3 more comments
Thanks gopy, but I still need the files to be created in the directory " /mnt/mymnt/passwords " and with the name " only_numbers_and_lettersNUM.txt "
– Onyic
2 days ago
@NourJandali: Then you improve the above script to suit your needs
– Basile Starynkevitch
2 days ago
1
I updated the answer
– gopy
2 days ago
what would you like to name the files?
– gopy
2 days ago
@BasileStarynkevitch I am new to Linux.
– Onyic
2 days ago
Thanks gopy, but I still need the files to be created in the directory " /mnt/mymnt/passwords " and with the name " only_numbers_and_lettersNUM.txt "
– Onyic
2 days ago
Thanks gopy, but I still need the files to be created in the directory " /mnt/mymnt/passwords " and with the name " only_numbers_and_lettersNUM.txt "
– Onyic
2 days ago
@NourJandali: Then you improve the above script to suit your needs
– Basile Starynkevitch
2 days ago
@NourJandali: Then you improve the above script to suit your needs
– Basile Starynkevitch
2 days ago
1
1
I updated the answer
– gopy
2 days ago
I updated the answer
– gopy
2 days ago
what would you like to name the files?
– gopy
2 days ago
what would you like to name the files?
– gopy
2 days ago
@BasileStarynkevitch I am new to Linux.
– Onyic
2 days ago
@BasileStarynkevitch I am new to Linux.
– Onyic
2 days ago
|
show 3 more comments
Onyic is a new contributor. Be nice, and check out our Code of Conduct.
Onyic is a new contributor. Be nice, and check out our Code of Conduct.
Onyic is a new contributor. Be nice, and check out our Code of Conduct.
Onyic is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372892%2fhow-to-create-multiple-files100-files-and-they-can-contain-30-random-character%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
There doesn't appear to be a question here. Please could you describe why what you've tried doesn't work?
– Roger Lipscombe
2 days ago