Linux Search Pattern Question:

Indicate the right option to search for anything not a letter or number:
a) grep '^[a-zA-Z0-9]'
b) grep '[^a-zA-Z0-9]'
c) grep '[a-zA-Z0-9]'
d) None of the above in Search Pattern

Search Pattern Interview Question
Search Pattern Interview Question

Answer:

b) grep '[^a-zA-Z0-9]'


Previous QuestionNext Question
One of the entry of /etc/passwd file is shown below:
user1:x:1111:2222:google:/home/user1:/bin/bash
Which among the following will print userid and home dir in the following pattern "user1:/home/user1"?
a) awk `{print $1 ":" $6}` /etc/passwd
b) awk `{print $1 ":" $7}` /etc/passwd
c) awk `{print $2 ":" $6}` /etc/passwd
d) awk `{print $2 ":" $7}` /etc/passwd
What command is used to list contents of directories?
A. tar
B. dir
C. lp
D. ls
E. None of the above