_                    _
  ___ | |__   __ _ _______ | |_
 / _ \| '_ \ / _` |_  / _ \| __|
| (_) | | | | (_| |/ / (_) | |_
 \___/|_| |_|\__,_/___\___/ \__|

cutsplit strings

back_to_top

-d | delimeter
-c | split by character count
-d | split by character (specify delimeter)
-f | specify field count. Use n,-n,n-
-f 2, gets 2nd field; -f -2, gets up to the 2nd field; -f 2-, gets from the 2nd field to the end
$ echo "a b c" | cut -d " " -f 2
b
$ echo "a b c" | cut -d " " -f 2-
b c
$ echo hello | cut -c 2
e

back_to_top

text_manipulation

cut(1)

<cut.oh>

back_to_top

ohazot | about | ohazot.com <admin@ohazot.com>

Created:2025-10-03|Updated:2025-10-06 OpenBSD linux