TOOL » LINUX » PACKAGE

Cut

Usage

shell
cut OPTIONS FILE
OptionDescription
-d --delimiterUse the given delimiter instead of TAB for field delimiter.
-f --fieldsselect only these fields.

Example

Split by /, get the 3rd element.

shell
echo 'refs/pull/123/merge' | cut -d / -f 3

Remove first 2 characters (start from 3th character).

shell
echo '1234567890' | cut -c 3-