nano ~/.bash_aliasesPaste this func:
randstr() {
# Use the first argument ($1) if provided, otherwise default to 48
local length=${1:-48}
tr -dc 'A-Za-z0-9' < /dev/urandom | head -c "$length"; echo
}Then Ctrl+O to save and Ctrl+X to save.
source ~/.bash_aliasesAfter this you can use it from terminal like:
randstr
or
randstr 64 << here 64 is the number of chars to output