I need to extract an archive and create a empty file in each of the folders contained within the archive.
I tried this:
for folder in `ls -d1 */` ; do touch "${folder}/COMPLETE"; done;
works just perfect till someone creates a folder with a space in its name.
How can I do this for all folders with or without spaces in their names?
\Hugo
Select the item you want to delete. Press and hold the Shift key, then press the Delete key on your keyboard.
Here, an empty directory means the directory is present without any files or subdirectories. We can define a directory as a collection of files and subdirectories, a directory may have data or not contain no data. The non-empty directory means the directory with files or subdirectories.
In Windows filesystems, size of a directory is the sum t otal of all files (and folders) in it. So, an empty directory has size zero.
You can use find instead:
find . -type d -exec touch {}/COMPLETE \;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With