Author Topic: grep {} \;  (Read 892 times)

0 Members and 1 Guest are viewing this topic.

Offline bociub

  • Jr. Member
  • **
  • Posts: 1
  • Karma: 0
  • I've just joined!
    • View Profile
    • Awards
grep {} \;
« on: September 22, 2021, 09:36:40 pm »
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?

Thanks!

Offline Brian000

  • Jr. Member
  • **
  • Posts: 27
  • Karma: 3
    • View Profile
    • Awards
Re: grep {} \;
« Reply #1 on: September 22, 2021, 11:49:57 pm »

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.



The Linux Community Forum

Re: grep {} \;
« Reply #1 on: September 22, 2021, 11:49:57 pm »

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal