3 ms·
Does not work well if you also care about hidden files : [simula67@hades test_bash]$ touch .hidden [simula67@hades test_bash]$ touch not_hidden [simula67@had
by simula67 12y ago
Does not work well if you also care about hidden files :
[simula67@hades test_bash]$ touch .hidden
[simula67@hades test_bash]$ touch not_hidden
[simula67@hades test_bash]$ find . -type f
./not_hidden
./.hidden
[simula67@hades test_bash]$ ls -al
total 8
drwxr-xr-x 2 simula67 simula67 4096 Jul 7 00:32 .
drwx------ 40 simula67 simula67 4096 Jul 7 00:31 ..
-rw-r--r-- 1 simula67 simula67 0 Jul 7 00:33 .hidden
-rw-r--r-- 1 simula67 simula67 0 Jul 7 00:33 not_hidden
[simula67@hades test_bash]$ for f in ; do echo $f; done
not_hidden
You have use shopt -s dotglob
[simula67@hades test_bash]$ shopt -s dotglob
[simula67@hades test_bash]$ for f in ; do echo $f; done
.hidden
not_hidden