Help finding specific words in a file

Robert22

New Member
Joined
Aug 6, 2021
Messages
1
Reaction score
0
Credits
11
Hey im trying to see if the 'passwd' file contains the word "root"
how can this be done?

Many thanks in advance!
 


Are you looking for:

Code:
sudo cat /path/to/file | grep root

sudo may or may not be required, depending on the file's permissions. It won't hurt if you use it.

Hmm...

You could check to see if it's stored where the system normally stores passwords, I think.. I'm pretty sure. I may have a bit more wine than normal in me, but it'd look like this:

Code:
sudo cat /etc/shadow | grep root
 
Hey im trying to see if the 'passwd' file contains the word "root"
Code:
grep root /etc/passwd
You might get something similar to this
Code:
grep root /etc/passwd
root:x:0:0:root:/root:/bin/bash
 

Staff online


Top