Karan's Programming Notes
Generate Random String
Initializing search
    mr-karan/notes
    mr-karan/notes
    • Home
      • CLI
      • Cloud Init
      • EC2 Metadata inside Docker
      • EC2 Pricing
      • View the volume ID in Instance
      • FAQ
      • Snippets
      • Vault
      • Query Snippets
      • Securing server with RBAC
      • CLI
      • Custom Build Output
      • Custom DNS Server
      • Custom subnet
      • CI
      • Decode JSON with proper types
      • Gotchas
      • Inspect HTTP Headers
      • Open File Descriptors
      • Profile Golang Applications
      • Update Golang Version
      • CLI
      • Debug CNI Issues
      • Control Brightness
      • Create a MacOS like screenshot effect
      • Filesystem
      • Git
      • JournalD
      • Networking
      • SystemD
      • cURL
      • Ps
      • Rsync
      • Sed
      • Add Table of Images in Markdown
      • Connect to Pritunl with a custom DNS server
      • API
      • CLI
      • Editor setup
      • Single Node Setup
      • Service List
      • Generate Million Rows
      • Reset WAL Log
      • Open File Descriptors
      • Transform requests to cURL
      • UTC to Local Time
      • Generate Random String
      • Get filename using bash
      • Get number of cores using bash
      • Line count for each file
      • Most used shell commands
      • Run a command as a different user
      • Shellscript Template
      • View a CSV file in Terminal
      • Snippets
      • Snippets

    Generate Random String

    You can use the following ways to generate a random string (helpful in cases like generating a random password in a shell script etc):

    • tr -dc A-Za-z0-9 </dev/urandom | head -c 13 ; echo ''
    • openssl rand -base64 12
    Previous UTC to Local Time
    Next Get filename using bash
    Made with ❤️ by Karan.
    Made with Material for MkDocs