Brief: This tutorial will help you understand how to split a string based on a specified delimiter.
Use linux cut command to split a string based on specified delimeter. Use delimeter with -d command line option as below.
1 | echo "root:x:0:0:root:/root:/bin/bash" | cut -d ":" -f6 |
Output:
/root