In Terminal I do this command:
ls --all --recursive -1 *.htm*
or this:
ls -a -R -1 *.htm*
But it only lists the html-files in the current directory...?!
According to 'man ls' that option has this function:
-R, --recursive
list subdirectories recursively
I know from Krusader Search that there are about 40 html-files in the sub-folders... But why will 'ls' not list them?
I might add that I just discovered that the following command does the job:
find . -name '*.htm*'
It works slightly different than you expect.
ls
will list the files and directories that you specify on the command line. With the-R
or--recursive
option, it will go into any directory that is specified on the command line.You do not have directories that match
*.htm*
in the current directory, only files. Therefore, only the matching files are listed.find
is probably the most suited tool to find files recursively, but it could also be done withls -R
andgrep
:grep
is used here with a regular expression.