[awk] Reorder columns

Created on November 30, 2026

Pass the fields to print in the order you want. For this users.txt file, print the third field first, followed by the first and second fields.

Alice 30 Tokyo
Bob 28 Osaka
awk '{print $3, $1, $2}' users.txt
Tokyo Alice 30
Osaka Bob 28
awk Shell command