<p>I want to find a linux command that can return a part of the string. In most programming languages, it's the <code>substr()</code> function. Does bash have any command that can be used for this purpose. I want to be able to do something like this...
<code>substr "abcdefg" 2 3</code> - prints <code>cde</code>.</p>

<hr>

<p>Subsequent similar question:</p>

<ul>
<li><a href="https://stackoverflow.com/questions/428109/extract-substring-in-bash">Extract substring in Bash</a></li>
</ul>

From the bash manpage:
```
```
${parameter:offset}
${parameter:offset:length}
        Substring  Expansion.   Expands  to  up  to length characters of
        parameter starting at the character  specified  by  offset.
[...]
```
```
Or, if you are not sure of having
```
bash
```
, consider using
```
cut
```
.