find a file containing some text

boredsquirrel@slrpnk.net to Linux@lemmy.ml – 156 points –
Use "find" and "-exec" to unleash Linux superpowers: Lil' Linux Lesson!
youtube.com

TL;DW

# find with grep
# + concatinates results and runs the command once, faster
find . -name "*.txt" -exec grep -l "somename" '{}' '+'

# run a command for each result individually
find . -name "*.txt" -exec basename '{}' \';' |  column

# case insensitive
find -iname "SoMeNaMe.TxT

# file or dir
find -type f
find -type d

# define file owner
find -user Bob

# define file group
find -group wheel

# by permission
find -perm 777

# find by size
find -size +1G
27

You are viewing a single comment

I prefer to watch videos via peertube, not youtube, whenever possible. She has a peertube channel so here is the same video there: https://tinkerbetter.tube/w/g8K2zBgwwwE1xukkT6EmSo

It is important to have backups for when Youtube blocks clients, but I just watch it over a VPN and Freetube or Grayjay. Not leeching any resources when avoidable, just costing big brother money.

You're giving all your data to your VPN company, though

True. But I pay them via Monero

And give no personal information? Like Mullvad? That is an improvement.

Yup. Also their VPN app on Linux is better than what KDE and GNOME have. Poorly. They hook into it very intensely, early boot blocking via a systemd service and all.