Posted in linux
217
2:47 am, July 12, 2020

loop through each directory in a target directory

i thought this would be useful for backing up all files in the /var/www/html/ directory rather than having to do each seperately, this loops through all of them

loop through each directory in a target directory Demo

View Demo Full Screen View Demo New Tab

loop through each directory in a target directory Code

Scripts

# backup.sh
for d in /var/www/html/*/ ; do
    echo "$d"
done

Related Tags

No Items Found.

Add Comment
Type in a Nick Name here