Unix: Cut a string along with delimiter
<p>I am using below command to cut a string based on delimiter. But i want the output to be printed along with delimiter.</p>

<p><strong>Sample string:</strong> test_file.txt</p>

<p><strong>Command:</strong> </p>

<pre><code>echo "test_file.txt" | cut -sd_ -f1
</code></pre>

<p>Current output: test</p>

<p>Expected output: test_</p>

<p>EDIT: i am using cut -sd to report null if the string doesnt contain the delimiter. so if the delimiter is not present, i should get output as null too. </p>