> For the complete documentation index, see [llms.txt](https://til.yulrizka.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://til.yulrizka.com/bash/parameter-expansion.md).

# parameter expansion

**getting only the file name without extension**\
\*\*\*\*`${FILENAME%.*}`

**getting only the extension**\
\*\*\*\*`${FILENAME##*.}`

**remove first folder (until / )**\
\*\*\*\*`${FILENAME#*/}`

**getting filename**\
\*\*\*\*`${PATHNAME##*/}`

Much more on <https://wiki.bash-hackers.org/syntax/pe#substring_removal>
