Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i list all .jpg files for my current directory and below 2

Status
Not open for further replies.

farley99

MIS
Feb 12, 2003
413
US
how do i list all .jpg files for my current directory and below?

I tried
ls -r *.jpg
but it only does the directory I am in.
 
find . -name '*.jpg' -print

Hope This Help
PH.
 
bash-2.05a$ find . -name *.htm -exec ls -la {} \;
find: paths must precede expression
Usage: find [path...] [expression]
bash-2.05a$ find . -name *.htm -exec chmod 777 {} \;
find: paths must precede expression
Usage: find [path...] [expression]

Why do i get that error?

Got any tips?
 
Try something like this:
Code:
find . -name '*.htm' -exec ls -la {} \;
#            ^     ^
If the error persists, post the result of
Code:
 pwd
command

Hope This Help
PH.
 
Also, some shells need the braces escaped.
Code:
    find . -name '*.htm' -exec ls -la \{\} \;
And make sure there's a space in front of the "[tt]\;[/tt]".

The Korn shell seems to be picky about this.

Hope this helps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top