Skip to content
Justice Tech School

tr, cut and paste

tr translates characters, cut selects fields and paste joins lines.

Example
echo "Hello" | tr a-z A-Z
echo "a:b:c" | cut -d: -f2
echo "abcdef" | cut -c2-4
printf "1\n2\n3\n" | paste -sd,
echo "aabbcc" | tr -s a-c

Result

HELLO
b
bcd
1,2,3
abc

Exercise

Select a field.

cut -d:  2

Quiz Test

What does tr -d do?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.