awk

上級
1/6
user@linux:~/workspace$
awk '{print $1}' data/users.csv

Explanation

Prints the first column of each line. Default separator is whitespace.

Options

-FSet field separator
-vDefine variable
1id,name,email,role,created_at
21,Alice Johnson,[email protected],admin,2025-01-15
32,Bob Smith,[email protected],user,2025-02-20
43,Carol Williams,[email protected],user,2025-03-10
54,David Brown,[email protected],moderator,2025-04-05
65,Eve Davis,[email protected],user,2025-05-12
76,Frank Miller,[email protected],user,2025-06-18
87,Grace Wilson,[email protected],admin,2025-07-22
98,Henry Taylor,[email protected],user,2025-08-30
109,Ivy Anderson,[email protected],user,2025-09-15
1110,Jack Thomas,[email protected],moderator,2025-10-01