bashHow to extract file extension
filename=/tmp/test.php
extension="${filename##*.}"
ctrl + c
"${filename##*.}" extracts file extension. Use |
More of Bash
- Urlencode string in bash
- How to convert string to lowercase
- How to check if a string starts with a specific value
- Output italic text in console
- Output bold text in console
- How to check if a command exists
- How to search and replace string in variable
- Binet's Formula in bash
- How to convert string to uppercase
See more codes...