Strip a matching prefix from a string.
Section: String Operations
Trim prefix pattern
bash
bash
url='https://example.com'
echo "${url#https://}"Explanation
Pattern-based trimming is faster than spawning external tools.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing String Operations