bai 1: su dung awk in tat ca file /etc/passwd awk '{print}' /etc/passwd hoac co the viet awk '{print $0}' /etc/passwd bai 2: in ra cac dong co ten la 'kevin' awk '/kevin/ {print}' /etc/passwd bai 3: in ra cac trung dau tien cua file /etc/passwd awk -F: '{print $1}' /etc/passwd bai 4: in ra truong dau tien va sap xep theo bang chu cai awk -F: '{print $1}' /etc/passwd | sort bai 5: in ra truong 1,3,5 trong file /etc/passwd awk -F: '{print $1,"\t",$3,"\t",$5}' /etc/passwd hoac co the phan cach cac truong awk -F: '{print $1,"--",$3,"--",$5}' /etc/passwd bai 6: in dong thu 5 trong file /etc/passwd awk "NR==5{print;exit}" /etc/passwd bai 7: liet ke tat ca cac nguoi dung tren he thong dc ta bang lenh useradd user tren he thong co 500<=id<=60000 awk -F: '$3>=500 && $3<=60000{print $1""$3}' /etc/passwd
0 Comments
G+ Comments
Comments

0 comments:

Post a Comment

 
Top

Nhận xét mới đăng tải!

Loading…
X