Search code examples
linuxbashglob

Linux shell select files in directory and subdirectiry


For selecting all php files in a folder , we use :

vim *.php

How to use this command for selecting *.php files in this directory and his subdirectories ?


Solution

  • With shell option `globstar`` in bash you can use

    vim **/*.php
    

    To enable the shell option use e.g.

    shopt -s globstar