How to go to each directory and execute a command?

后端 未结 10 1004
無奈伤痛
無奈伤痛 2020-12-02 04:13

How do I write a bash script that goes through each directory inside a parent_directory and executes a command in each directory

10条回答
  •  抹茶落季
    2020-12-02 04:22

    for dir in PARENT/*
    do
      test -d "$dir" || continue
      # Do something with $dir...
    done
    

提交回复
热议问题