Unix/Linux Go Back    

BSD BSD, sometimes called Berkeley Unix, is a Unix operating system developed by the Computer Systems Research Group of the UC Berkeley.

Mcookie, pkg -l to generate random sequence


bsd, generate random sequence alphanumerical, mcookie, solved

Thread Tools Search this Thread Display Modes
Old Unix and Linux 10-07-2015   -   Original Discussion by 1in10
1in10's Unix or Linux Image
1in10 1in10 is offline
Registered User
Join Date: Jun 2014
Last Activity: 10 August 2017, 2:46 PM EDT
Location: Brazil
Posts: 122
Thanks: 38
Thanked 4 Times in 4 Posts
(solved) Mcookie, pkg -l to generate random sequence

I am setting this thread to this bsd forum, though it may fit into bash. But as using bsd and the terminal, I would like to generate a random sequence of alphanumerical digits, such as I use to do so on linux by typing just


this one gives me a pretty random password, but it does not on bsd 10.1.
Does someone have any idea without creating that via

tr -dc a-z1-9 < /dev/urandom

or other similar constructions even more complicated?
by typing

pkg -l

the list of commands is pretty short. Hitting twice the tab-space as root does not help either as is lists all in linux.
Any hints? Thanks in advance.

So I have been trying the following command without success, because md5sum and sha256sum or higher are not present on my bsd, for either root or user.

date  | m5sum

as well with the other ones.
While typing the following longer command (I read the manual about random and urandom)

cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n1

all I get as an answer is

tr: Illegal byte sequence

Someone may knows what is wrong with this lack of commands? And is there a shorter way to generate such a random password? Thanks in advance.

Solved, or lets say, for this particular case, solved, because any attempt with tr went to illegal byte sequence, so the following line did it.


Last edited by 1in10; 10-08-2015 at 11:12 AM.. Reason: S O L V E D
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Need to generate a file with random data. /dev/[u]random doesn't exist. Devyn Shell Programming and Scripting 7 08-22-2013 11:23 PM
generate a sequence vaibhavkorde Shell Programming and Scripting 4 04-15-2011 12:28 PM
Generate random number luoluo Programming 1 05-16-2010 03:01 AM
Generate Random Password in C vjaws Programming 2 06-11-2008 02:58 PM
Generate a Sequence like in Oracle keshav_rk UNIX for Dummies Questions & Answers 1 03-20-2008 10:43 AM

All times are GMT -4. The time now is 09:08 PM.