Recursively look for files with a specific extension

后端 未结 10 1452
抹茶落季
抹茶落季 2020-11-29 14:38

I\'m trying to find all files with a specific extension in a directory and its subdirectories with my bash (Latest Ubuntu LTS Release).

This is what\'s written in a

10条回答
  •  无人及你
    2020-11-29 15:01

    1. There's a { missing after browsefolders ()
    2. All $in should be $suffix
    3. The line with cut gets you only the middle part of front.middle.extension. You should read up your shell manual on ${varname%%pattern} and friends.

    I assume you do this as an exercise in shell scripting, otherwise the find solution already proposed is the way to go.

    To check for proper shell syntax, without running a script, use sh -n scriptname.

提交回复
热议问题