Need an explanation on \; and the end of commands

SpongeB0B

Member
Joined
Feb 11, 2022
Messages
30
Reaction score
7
Credits
270
Hi everyone,

I would like to know exactly what does
Bash:
\;

at the end of the example that I saw online

example 1
Bash:
find /var/log -name *.log -exec ls -l {} \;

So If I get it well
Find will look in /var/log for files named *.log then will execute ls -l on each result ( {} = the output list ? )

I've try without \; at the end and I get Find: missing argument to -exec why ?

why we need to escape and and ; ?

Thanks
 


It denotes the end of the exec argument.

 
The link provides useful info, but the semi-colon is escaped essentially so that the find command reads it and so it's not interpreted separately by the shell.
 

Members online


Top