You can now choose from a number of pre-installed themes

grep {} \;

Started by bociub, September 22, 2021, 09:36:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Hi folks,
I am a student and looks like nearly impossible to google out what the "{}" and the \; want to exactly mean in this command:

find /usr/share/doc -type f -exec egrep -i -H -1 '3d (modeling|printing)' "{}" \; | cut -c -100

Can anyone enlighten me?



I assume you know the rest of the command but:
"Find all files in /usr/share/doc and execute egrep (with various parameters) for all files, but return only the 100th character. "

The "{}" means all files from the find command (think of it as a variable or an array/collection containing the return from the "find" command)
while the /; is the command terminator with an escape character "\" to stop it from being interpreted as part of the command.