echo ${#VAR}

Category: Shell & Bash

echo ${#VAR}

Print the length of a variable's value

Prints how many characters are in the variable's value. ${#VAR} is 'string length of VAR'.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.