0

I have a command written in my notes, but I can't figure out what exactly it does. Can you please help me?

Here it is:

find / f1 -exec ls -l {} \;

It searches for the file f1 in the root directory and executes ls -l, but the files from which directory will ls-l show and what the end mean - {} \;?

Thank you in advance! :)

Faery
  • 4,552
  • 10
  • 50
  • 92
  • 2
    type `info find` into your shell in order to read the documentation about find. – Marcin May 12 '13 at 15:59
  • Thank you, sorry for the duplicate :S but I can't delete it now. – Faery May 12 '13 at 16:00
  • you can use `-name` option to search for filenames. – Bill May 12 '13 at 16:00
  • 1
    Technically, that command should be executing `ls -l` for every file it finds under `/`, *and* any files under a directory `f1` in the current working directory, unless the space between `/` and `f1` is unintentional. – chepner May 12 '13 at 16:02
  • Thank you very much! I understand it now. I wasn't quite sure about the role of `f1` – Faery May 12 '13 at 16:04

1 Answers1

2

the notation {} means: insert filename here. \; is end of -exec

Your man page should have told you so.

Angelo Fuchs
  • 9,825
  • 1
  • 35
  • 72