Display users with symbol 'w'
Hello everyone. Please i need your help to display users in a system that contain 'W' symbol in their name and store the information in a file. Thank you
'cat /etc/passwd' just display all users. |
This looks a bit like homework to me, so I'm going to provide a hint:
The grep command comes to mind. You do need to be careful and write a regular expression that only looks at the username field. |
Home schooling
Quote:
I know cat /etc/passwd display all users. I need to know how to filter by displaying users with a particular character or symbol in their name. Thanks |
Using grep:
Code:
grep "^.*a.*:x:" /etc/passwd Code:
awk -F: '$1 ~ "a" { print }' /etc/passwd |
Reply
Quote:
|
I used an a instead of a w in my example.
|
Thank
Thanks drunna. I appreciate
|
Quote:
|
All times are GMT -5. The time now is 08:01 PM. |