Q: How do I search for a specific text string in a all files?

 

A: Say you want to find the string "sysadmin" in all files recursively in the folder /root/files.

 

# grep -R "sysadmin" /root/files/* > /root/files/sysadmin.txt

Saves all found duplicate lines to the file sysadmin.txt.

 

# sort -u /root/files/sysadmin.txt > /root/files/sysadmin.deduped.txt

Sorts and removes all duplicate lines, leaving one, then saves to the file sysadmin.deduped.txt.

 

 

Sources

https://www.cyberciti.biz/faq/unix-linux-shell-removing-duplicate-lines/

Stop Spam Harvesters, Join Project Honey Pot

 

Get a free SSL certificate!

 

The leading nonprofit defending digital privacy, free speech, and innovation.

 

The Linux Foundation provides a neutral, trusted hub for developers and organizations to code, manage, and scale open technology projects and ecosystems.

 

Kubuntu is an operating system built by a worldwide community of developers, testers, supporters and translators.

 

 43ef5c89 CanonicalUbuntudarktext