grep command examples Flashcards

1
Q

lines starting with the string “root”

A

cathy ~> grep ^root /etc/passwd

root:x:0:0:root:/root:/bin/bash

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

lines ending in “:”

A

cathy ~> grep :$ /etc/passwd

news:x:9:13:news:/var/spool/news:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

check that PATH is exported in ~/.bashrc

A

cathy ~> grep export ~/.bashrc | grep ‘\

export PATH=”/bin:/usr/lib/mh:/lib:/usr/bin:/usr/local/bin:/usr/ucb:/usr/dbin:$PATH”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly