$ ls -l
total 0
-rw-rw-r-- 1 t t 0 Jun 8 16:37 'file; echo hello'
$ find . -exec echo {} \;
.
./file; echo hello
I was wondering why the following command doesn't ls -l
each file in the current directory? Why does it report some file named 1
? Thanks.
$ find . -exec sh -c "ls -l $@" sh {} \;
ls: cannot access '1': No such file or directory
ls: cannot access '1': No such file or directory
$ find . -exec sh -c "echo ls -l $@" sh {} \;
ls -l 1
ls -l 1
sh
on your system? – Arkadiusz Drabczyk Jun 08 '18 at 20:52