I have several directories which contain hidden empty files. I need the name of these file names themselves, so I need to write the filenames to a txt file. My script looks like this:
cd /z/all_vendors/
x=`find vendors -perm 755`
for FILE in $x; do
ls -a $FILE >> locator.txt
done
However I get a permission denied error
How do I write these hidden file names to a directory?
EDITS the vendors directory has subdirectories in the following way
vendors/
|__000123
|__000204
|__000404
so x=`find vendors -perm 755` finds all subdirectories with certain permissions
Each of the 000xxx subdirectories have the following tree structure:
000xxx/
.
..
.kpypjn32rz6l
.66jwvo6x96sj
etc where the hidden files start with a dot
I need to write the names of the hidden files to a txt file for example 'kpypjn32rz6l'